#development
1 messages · Page 31 of 1
1
@soft umbra put in printf("\n\t\t");
before the beginning of the second loop
how do I link two fonts in the <head> tags and then use one font for some text and another font for more text.
or like how do I set the font for a specific text tag
using like a google font link
.
Sorry so vague
basically got main text I need in opensans 600 then sub text in opensans 300 then subsub text in opensans 300i
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<style>
body {
font-family: 'Roboto', sans-serif;
}
</style>
</head>
<body>
</body>
</html>```
<div style="font-family: 'Roboto', sans-serif;"> Roboto text </div>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<style>
.font {
font-family: 'Roboto', sans-serif;
}
</style>
</head>
<body>
<div class="font">
Roboto text
</div>
</body>
</html>```
.class {}
<div class="class"> </div>
.font {}
class="font"
.class1
.class1 > .font {}
.class {
background: red;
}
<div class="class"></div> = affected
.
https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400
https://fonts.googleapis.com/css?family=Roboto:100
background:red;
replace onloadstart="this.volume=0.4" with volume="0.4"
"Did someone say banana!?"
font-style: italic;
hi devs hows it going
jiffy
I make databases 
I make errors 
is anyone good in godot
i make low quality apps in VB 
same
It's been so long since I did front-end code that I forgot basic jQuery syntax.
time to use proper JS then
pft vb
I like to program in the best language ever
its called Cobol 
Im just a front-end web developer so thats a lie
@vestal glen I've been working with Node.js for over a year since someone else took over the front-end. Went to troubleshoot and found myself facing jQuery, and had to take a few minutes to re-acquaint myself. :p
Is source a good engine to use with games? i think it is
anyone want to teach me how too make a sound play onhover
@gray hazel not unless you want specific source engine features
It's a really outdated and old engine that's been patched a bunch and mutilated to work in a modern world
Unless you pay the money for access to the most updated version
That they've overhauled a lot of it in
from theoatmeal.com
jesus what?
- Hmmm, I wonder what all this code does 😎
all kinds of things...
Hehe, yea xD
one thing it doesn't do is apply that java update though
True xD
Any idea, on how I change the date output, so it says it like DD. MM - YYYY? 🤔
@whole quail well I most likely will use the 2007 build. Same one that the black Mesa sourcemod uses
But they need more work
I’ve tried it
A sourcemod works from the moment you make it
If you can't get unreal or unity to work you're gonna have a massive problem getting source to work
Source is easy
There's so much that needs to be changed with the engine to make it useful
It can see files from other games
That's the one thing it does well
Just use unreal
If you can't get it working in unreal you're not gonna have a chance working with source
Unreal is nice
It's a good balance of modern and powerful while also being easy to develop for
ok
i will tri it again
but also sticking with source at the same time
cus i am very used to it
and i have always been a fan of it
if you want to see it's full potential, just watch a ganeplay of the Black mesa december 2017 update
Read Garry Newman's views on it
My comparison between the Black Mesa 2015 Version and the 2017 December Update (recently been released). Hopefully I covered everything! EDIT: Everyone is as...
They aren't using the version you are
That's source 2
And modified most likely
If you can't modify it and you don't have access to the modern version it'll only end badly
?!?!?!?!
the latest is source 2013
Source 2 has been out for quite a while lol
Source 2 is still a myth
It's been used for dota 2 for quite a while now
And parts of it have been used in csgo
yes
but not black mesa
going from source 2007
to source 2
is a huge pain
because everything has been re-done
XEN levels wouldn't be here
Source 2 is literally just post source 2013 lol
lol
It's just another set of incremental updates except they removed some legacy stuff
It's modified to hell
Source out of the box isn't like that at all
A lot of people who have actually created games in it have talked a lot about how they needed to modify it
yeah
Garry Newman and Facepunch being the most prominent
it can be tough
They ditched source almost completely now lol
but if you don't fuck it up, the game can come out really good
And they have access to the latest versions
You're not going to be able to pull it off
If you could you would already know exactly what you were doing
i am a begginer to source modifications
but i know enough to not fuck it up
and i have already created a few things
What have you modified in the engine so far>
not much
Also for a good example of how to use the source engine look at titanfall
i started yesterday
i am making a benchmarking utility
a proper one
although i am using one of the original copies of source
source 2004
but it's still really good
@whole quail titanfall used the latest revision of the Source tree
the one you've gotta, yaknow
pay for
most of it is just the physics licensing, but it's like $10k
You only pay if you want to use source commercially, otherwise it’s free
The SDK is free on steam
And the license is exactly $25,000
For commercial use
@main wyvern I tried eveything is too vague 🤔

@gray hazel reeeee, 2004 engine in 2018
new APIs are soo much more efficient both CPU and GPU side.
^
Also the engine just flatout is missing crucial components especially around lighting
And support can be terrible
Especially with windows 10
@gray hazel no dude, that's not how it works
the old branches are free.
to get full code access to the new, actually good branch of Source you need to pay the license fee
Source 2013 is the best you get, and even that has a lot of missing improvements that games like Portal 2 had
not to mention source 2 then^^
yup
the SDK may be open source, but the actual engine is
super not.
source 2 and the actual, updated versions of the mainline source engine is ❤
well, relatively speaking.
the public SDKs are public for a reason, and that's because they aren't really worth a whole lot.
if a company can afford to spend all that time and money bringing Source 2013 and prior up to modern standards (which they would still need to pay for, by the way), they'd rather just pay the money upfront to get an actually decent engine like Source 2
Also it's not $25k btw
The price is super confidential and can get well into the hundreds of thousands
Maybe $25k as a starting point but that'd be it
When building a game for millions of dollars spending a few hundred thousand on an engine is nothing compared to the cost of the developers, lawyers, etc...
@thorny galleon does source 2 have OpenGL support?
i mean, i know valve has their OpenGL layer, but more is it a primary API in that engine?
vulkan is a primary api there, even afaik
even better.
tests by valve have sown OpenGL to be faster than DX11-, and Vulkan is know to be faster than DX12
besides that they run on linux ofc.
I'd like a world where DX didn't exist tbh
A single cross platform standard would be nice
how would one recommend i go about a common shader ingest for both OpenGL 3.3 core (GLSL only) and Vulkan (SPIR-V only).
and if possible, OpenCL 1.2 ingest aswell.
@whole quail know of a cross compiler that can do that?
Nope my experience with that sort of stuff is rather limited
50% because of time, 50% because of hating myself each time I learn the maths behind 3d rendering
Although right now I think I'm hating web development more than 3D rendering
the math is eazy
It's not hard, I just hate doing it
4D mathematics is ezpz
And it takes time to actually learn
try 128D of 128D math.
Right now I'm enjoying learning about kernel mode drivers work more in depth and working out how windows works at that level too
Actually specifically now I'm making a fucking website
And if I wasn't doing this I'd be solving stupid problems trying to sync trello with google sheets while dodging rate limits using napkin maths
rate limits usually give you a timeout period to wait for.
discord does that
Also that wouldn't help here anyway
Since it's instance based and each instance doesn't keep data about the last instance
Trello api fucking sucks though
If you want to retrieve all cards
You have to retrieve all cards and all their information
Instead of just id's
Which multiplies the bandwidth by like 14x
And hits a rate limit for me quickly
slow claps
If the client wasn't who it is I'd 100% not be doing this lol
I'm also doing it for real cheap but I honestly don't mind
I just checked to make sure and I can say who it is
I'll pm you
Hey any of u guys familiar with bios editing stuff? I can't save the. CAP file after tweaking it. Any suggestions?
It has dual bios. So I could learn something
Incase of brick, it kicks back to its original bios
In that case, I have no clue as to why the file wouldn't save.
Unless it's got an md5 check in it or something.
hmm...
What software are you using to mod it?
Aight. I use the phoniex tool. You know anyother tool to edit?
Ami
Try this AMI Firmware Update (AFU)
I tried ami editor at first, but it didn't even extracted it.
Give this a thorough read if you want https://www.bios-mods.com/forum/Thread-GUIDE-How-to-modify-AMI-MSI-BIOS-to-unlock-full-features-UEFI-Aptio4
BIOS Mods
Ensure none of it'll kill your stuff though
VERY IMPORTANT: Check that modified rom size match with the backup created in step 4, if mismatch don't continue you may be doing something wrong.
Okay I'll try those Thx
Sure
Well i got a week to learn to code and to learn a language and make a simple program
Not enough time im guessing
Nope
Well im fucked
@native wave any specific language?
If I have a mobo that doesn't have any error code indicators and only makes 4 beeping sounds to indicate that an error occurred (but this beeping also ins't indicative of the error), what troubleshooting steps do I take? Right now I didn't use a boot device or storage drive, I've tried trying a single stick of RAM in either of the available slots for both slots and both RAM sticks. The system doesn't output to any display, but it does stay on indefinitely after the 4 beeps occur until I turn it off
And the OEM doesn't have anything to explain the possible errors besides saying that it will make the 4 beeps if an error has occurred, whether or not the error was "fatal" or not
@swift niche #tech-support
Whoops my bad
@ionic hull heres how little i know, what languages are there
@native wave what kind of simple program you need? A simple console output? A program that has a GUI? Some kind of website maybe? Could you specify more?
Literally it has to take an input, and do ‘something’ no gui required
c++ would be easy
Ok ill start doing research
Ok thanks
until you understand the variables and console output part
Remedy Entertainment discussed the experiments and research we have done in collaboration with Nvidia on the Microsoft DirectX Raytracing (DXR) API that enab...
@tropic grail there is a problem with gigabyte bios . amibcp crashes while saving it .i tried msi bios .its fine . then i searched a lot and found a guy with same problem only in gigabyte bios for same mobo. today ill try thro dos
C# is good / easy, you don't have to deal with pointers so its easy to pick up. And has lots of useful support and library's and using visual studio basic GUI apps are piss easy. But this does mostly assume its desktop apps and you care mainly for windows
you cloning the UE4 source?
I just built a URL shortener. :V https://github.com/IceBladeNetwork/URLShortner
@devout lava
TBH. he was the main reason why I made it. :V
JavaScript people.
How come when I reference this property in an object, it returns null?
function setColor(object){
console.log(object.element.offsetHeight);
console.log(object.element.offsetHeight);
const bottom = object.element.offsetHeight + object.element.offsetTop;
const top = object.element.offsetTop;
/*
*/
}
The first two console logs print the offestHeight value, then it says the element is null when it tries to set bottom.
If I swap top and bottom, it says offsetTop's element is null.
Edit:
It is now telling me that it is still null, but when I do this, it logs the value correctly O.o
function setColor(object){
const offsetHeight = object.element.offsetHeight; // null
console.log(offsetHeight); // 1138
Am I just missing something?
Where's the object's variable height being set?
fwhat is it telling you is null, the element prop?
@tropic grail @proper saddle Mines built with PHP
Uses IIS redirect rules to redirect https://r.ryois.me/<id> to https://r.ryois.me/?r=<id> w/o showing it in the address bar
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^([_0-9a-z-A-Z]+)" />
<action type="Rewrite" url="?r={R:1}" />
</rule>
Should I have analytics on my URL shortner site?
My own
Ive just got source files of a Discord bot. I know that i need Visual Studio to compile them, but how do i exactly do it ? Ive never used Visual.
@devout lava i see no reason why not.
@nocturne galleon what language is the bot written in?
C#, hmm.
if it was C++, i would tell you to ditch the source, and use Java (better APIs, languages aside)
but C# im not sure, only used MSVS for C++
i have a good server for my bot
Discord.js is a solid lightweight option as well
Along with all of the requests and the method
JS, be prepared to get an even better server for that.....
Why?
Java is faster and lighter weight than JS.
Yes you can
😆
i want to see an interpreted garbage collected language beat even a bytecode language.
Java is higher performance, that’s correct, but nodejs has A LOT less memory overhead on object allocation
2018-02-27 21:44:26 GET / i=cc08bbda8v.png Mozilla/5.0+(Macintosh;+Intel+Mac+OS+X+10.10;+rv:38.0)+Gecko/20100101+Firefox/38.0 - 33522 367 765 3f3e528769039f11-ORD omitted IP CA https image/png - - heres an example
Java is also garbage collected
i know
Nice access log @devout lava 😛 what webserver is that ?
i know how the JVM works quite well.
IIS
Then why did you completely ignore the fact that Java has an even worse GC
its GC is fine.
But if you want good performance out of node you need to write c++ addons
For computations
and i did not, i just specified that you cant interpret C++ and say its better.
But in I/O it crushes anything
because C++ just works that way.
You can interpret c++
yes
i mean, C++ memory management.
no, fully interpreted live code changes C++
there is an interpreter that will do it.
dude go google some more lol
Crap. Left laptop on this channel
Do you even know how V8 works?
It recognises patterns in JS code and replaces it with assembly
Look it up
It’s amazing
JVM JIT does that too
JS could have never been this fast without it
Yea some JITs are crazy good
does the V8 JIT do that too? (im not familiar with JS runtimes)
Yea up to a degree
V8 is in chrome and google made a lot of hardcoded fast paths as i believe they call them
the Java JIT can also do cross class linking to inline functions, and even objects.
thats like a native method in java, its got those too
Every *compiler should do that my friend 😉
@hasty pewter GCC cannot do it cross file.
LLVM is not a compiler
CLang cant.
MSVC cant
no C++ compiler can, not if you want fast compile times.
why would you care about that if you write C anyway? you probably are using C for a reason
why would you want fast compile times? computing power is cheap
stop bringing up stuff nobody cares about
I certainly don't
only if it was bottlenecking my program
or rather, linking times.
well, both
with C++ compile/link takes quite a while.
especially with MinGW
and im not even sure they can at all
i know for a fact that GCC cant.
the way the the JVMJIT compiles everything breaks soo many rules of a standard compiler.
@hasty pewter i want to see a benchmark where JS outperforms Java (given time for JIT warmup, so not startup time/performance)
it won't!
i said that already
it only will in memory consumption
unless you're working with massive strings
because JS uses UCS2
so memory is the only thing JS is better at?
java doesnt seem that bad at IO to me.
because thats not its main design concern?
correct
when given a memory constrained environment, will Java or JS perform better?
JS
like, needs 1GB, has 512MB to work with, and 512MB on disk.
but if you got enough memory Java will do better in computing intensive tasks
soo, my 32GB server, use Java.
yep, usually
now, what if i wanted to use an RPI?
unless you want to do a lot of connections that only proxy for example
Then probably Nodejs
but the newer RPis will run java fine as well
because 1GB of ram is enough?
yes granted you don't load a lot of data into memory permanently
so the conditions that JS needs to actually be better, basically dont exist?
yes they do, JS is single threaded and very efficient, especially in I/O, so if you do a lot of connections without significant computing JS will outperform anything else
Cloudflare runs on nginx + Nodejs
Paypal runs on nodejs
also, have you actually looked at the ram usage of a JVM, its much much lower than what TM shows.
It's gotten a lot better yeah
memory wise, not IO wise
and the more data you handle the more efficient java gets
the IO shit is just optimized C++
for java or nodejs?
JS
yes thats true
Java its at least partially written in Java.
its just libuv, which indeed is highly optimized C++ I/O, accessible to noob programmers
through JS
and better than noob ones as well of course...
also, just pulled up VisualVM with CLion, its using 1/1.2GB of ram
nginx uses libuv as well
thats a significant amount just sitting there, unused.
yeah, stupid if you think about it
but if you think about the economics its not that bad
actually had the GC run, full sweep, down to 433MB/1.2GB
soooo, its not that bad with ram usage, its juts not bothering when it doesn't need to.
at the end of the day your software stack / usable libraries are almost always more important than its performance
because really, what has too terrible performance to not even consider?
like D4J
current lua implementations?
no wait
those were actually quite well optimized IIRC
so nvm
IMO, Python, unless using it as a scripting language for libs like Tensorflow.
hmmm, i havent used python a lot but I faired quite well as interpreted language IIRC
im super performance critical, to the extent of not using LWJGL because its slower than raw C calls to OpenGL
and there's cython unless you consider that cheating
its performance is not bad at all, not for a fully interpreted language.
but its still not as fast as a bytecode language, which is (usually) not as fast as a well optimized compiled language, like GCC++
there are compilers to different kinds of runtimes for python.
thats runtime compilation, and it does that automatically
im talking about the official intpreter.
there are interpreters for C++, nobody cares to talk about the performance of those.
yes there is
no because bytecode is cross platform compiled code
it goes from python -> bytecode -> interpreter.
helps with interpreter speed, while being lower load than a full compiler at startup
and prevents self changing code
you're talking about AOT right?
yes, AOT compilation.
lol
imagine if this randomly turned into a gaming conversation
"OMG u play that game as well, it's sooooo cool"
can i complain about minecraft and its optimization?
YES
or rather, lack there of.
You certainly can
because it's a really bad example of how to use java in a game
2.1...
its an example of you can
its also an example of for the love of god dont do it this way
yea
but people just accepted its a total resource sucker and just went with it
instead of fixing it
really? does that have so much impact?
As you can tell I never investigated what's minecraft performance culprits
so its a nice stack like this cpp glBegin(GL_TRIANGLES) glPushMatrix(); glTranslate(1, 1, 1); glVertex(...); //... more glVertex(...); // glPushMatrix/glPopMatrix(); glEnd();
vs cpp glBindVertexarray(VAO); glDrawElementsInstancedBaseInstance(...); glBindVertexarray(0);
second one can draw thousands of polys with three calls
first can draw same thousands of polys with, three times the calls.
@hasty pewter ^
hmm
three times the thousands, not 9
didnt they use LWJGL though?
yes
LWJGL supports OpenGL 1.1 -> 4.6
its a mapping, not a layer.
Light Weight Java Game Library
its a very thin layer.
yeah but the idea of such a library is (usually) that you can quite easily go to a newer Opengl version without changing too much code
no no no no no
or is that not the case for LWJGL? i havent used it since before opengl 4 came out
as i said, its an OpenGL mapping, not a layer.
glVertex(1, 1, 1); calls glVertex(1, 1, 1); in C++
well, glVertex3f(float, float, float);, but same diff
LibGDX is the one you are thinking of
its implemented on top of LWJGL
and is well optimized
aswell as JMonkeyEngine
nope not at all
you familiar with highly parallel programming?
ive done a lot of multithreading work
not standard multithreaded
i mean like, thousands of cores.
yeah like OpenCL
is CUDA actually proprietary?
but the SDK?
runs on linux and windows
still Nvidia only
having an AMD GPU, i dont really like that
my laptop is intel and Ngreedia
but my desktop will soon be full AMD
transition from fully green team
just need to swap my 970 for my RX480 sitting on top, waiting to be installed in the loop.
Open standards and open source FTW!
yes please
but don't pull an android
"IT's open source! you just can't change anything when you use it and the drivers are vague NDA'd binary blobs"
yea, thats not what i mean.
i mean stuff like AMD's open source Linux drivers, OpenCL/GL/Vulkan, Linux in the first place.
sooo, not Nvidia, or Microsoft.
(:
@hasty pewter dont get my wrong, Nvidia makes a great product.
but for the price, you cant beat AMD on raw compute for GPUs
and Ryzen was a much better choice for me over Coffeelake
mostly because of price.
yeah glad there's an actual choice again
still kicks my 3770k's ass, and was only $350
for a board and CPU
1700X + Crosshair VI Hero mind you
soo, not a cheap board.
I need assistance with my html and JavaScript. I have a script so on hover i plays sound using sound id but i already have another mp3 playing how can I make it pause the other. if u think you can help ill send code in morning.
Has anyone used http://www.chartjs.org/ ?
Simple, clean and engaging HTML5 based JavaScript charts. Chart.js is an easy way to include animated, interactive graphs on your website for free.
@nocturne galleon i can help if you want
@nocturne galleon ```php
if( isset($_GET['r']) ){
$id = $_GET['r'];
if( file_exists("txt-db/$id.txt") ){
$get_long_link = file_get_contents("txt-db/$id.txt");
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"];
$country = $_SERVER["HTTP_CF_IPCOUNTRY"];
$user = md5(uniqid(rand(), true));
$time = date("Y-m-d h:i:sa");
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "urlanalytics";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
}
$sql = "INSERT INTO IDs (ID, Country, User, IP, time)
VALUES ('$id', '$country', '$user', '$ip', '$time')";
if ($conn->query($sql) === TRUE) {
} else {
}
$conn->close();
header("location: $get_long_link");
}else{
}
}
@devout lava you need to sanitize $_GET['r'] before you use it like that
?
you need to make sure I can't just do ?r=../somefile
but more importantly that I can't exploit your SQL
yeah
is it a number or a string?
0-9 a-Z
I think you can do this then:
$id = preg_replace('/[^a-zA-Z0-9]*/', '', $_GET['r']);
that will remove any non alphanumeric characters
oh ok
if( isset($_GET['r']) ){
$id = preg_replace('/[^a-z0-9]*/', '', $_GET['r']);
. . .
i edited it, add A-Z to support uppercase characters
ok
using PDO with emulated statements is better but it's fine because you control all the other variables that are in your query
or just use mysqli_real_escape_string($conn, 'example string')
Yeah I'm just gonna use object oriented
if you want to try an ORM you should check out Eloquent
it's made by Laravel but can be used standalone and only requires like 3 lines of code and a class to work
I'll stick with this 😄
@hasty pewter do you know of any good chart libraries that I can insert data with JSON?
<!doctype html>
<html>
<head>
<title>luc.hz</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=0.9,maximum-scale=0.9" />
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,600" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<audio autoplay="true" loop="true" volume="0.1";>
<source src="tbr.mp3" type="audio/mp3">
</audio>
<div class="container">
<h1 class="intro-text">luc.hz</h1>
<span class="sep"></span><br>
<span class="links">
<a href="httg">INSTAGRAM</a><span class="sep"> | </span>
<a href="httpll">STEAM</a><span class="sep"> | </span>
<a href="https://mn">FLICKR</a>
</span>
<br><br>
<script>
function PlaySound(mySound) {
var thissound=document.getElementById(mySound);
thissound.play();
}
function StopSound(mySound) {
var thissound=document.getElementById(mySound);
thissound.pause();
thissound.currentTime = 0;
}
</script>
<div class="font, playlist">
<a onmouseover="PlaySound('mySound')"
onmouseout="StopSound('mySound')"
style="text-decoration: none;" href="https://www.youtube.com/embed/videoseries?list=PLwGSEkTLkQ0O0BDcAwEehMb1f2ed1mh3t&autoplay=1">PLAYLIST</a>
</div>
</div>
<audio id='mySound' >
<source src="tbr2.mp3" type="audio/mp3">
</audio>
<video src="DJI_0047.mp4" type="video/mp4" autoplay=true loop=true>
</video>
<div id="particles">
<script src="particles.min.js"></script>
<script src="app.js"></script>
</div>
</body>
</html>
@hasty pewter
@devout lava no sorry but i think most of them take json
Ok
@nocturne galleon you need the YT JS api
you need to add enablejsapi=1 to the youtube url
here's a good example: https://developers.google.com/youtube/iframe_api_reference#Examples
<a onmouseover="PlaySound('mySound')"
onmouseout="StopSound('mySound')"
style="text-decoration: none;" href="https://www.youtube.com/embed/videoseries?list=PLwGSEkTLkQ0O0BDcAwEehMb1f2ed1mh3t&autoplay=1&enablejsapi=1">PLAYLIST</a>
@proper gale I added tracking, now I need to add a way to see them with out using phpmyadmin 😄
add a www.my.url/tracking.html?
that works too
lol
same idea
Now I need to figure out how I want to show the data
somwhere i have php source that shows how to do it in a simple grid
no idea how it works, why, or if it would be helpful.
i didnt write it.
@hasty pewter the playlsit is a different thing. I want to play a mp3 when I hover on the playlist text. It does that but I need to change the js to stop the old mp3 i think
Yeah I know how to make it display in a HTML table but I sorta want to show charts.
nor do i plan on figuring out how the fuck it does work
lol
oh, i would jump striaght to webgl but i know thats wayyyy overkill.
heres the table https://i.ryois.me/?r=k8MflTQjxLZC
i figured it would just be the urls, and how much they were used.
@nocturne galleon Then just use onmouseover="StopSound('mySound'); PlaySound('mySound')"
total uses, use/min, hot new ones, etc.
If i understand you correctly
Would it make sense to have a graph showing the number of people that have clicked or typed in the url on a line graph or something?
So like enter a ID and it shows usage over time?
i mean, i think it would be cool if it was behind the number
where the highest is 100%, and its relative to that one.
that could also be cool.
lot more DB space though
This is my project for the week 😄
tracking just the total number of uses is tiny, tracking over time takes linear sotrage space.
lot more db space?
depending on use, it could add up
god damnit it removed my all caps query
There shouldn't be a cap bot in this chat
yup, get ready add some BOTCASE!!!!!!
I figured if this is what you want you can just do:
SELECT URL, COUNT(*)
FROM ....
ORDER BY COUNT(*) DESC
GROUP BY URL
Would this be good?
Have a PHP script that echos JSON data?
The client sends the data it wants and it sends JSON?
😃
wouldnt I need to make the first mp3 id like 'mysound' or smthn??
How would I count how many entries have the same ID?
nvm @hasty pewter thanks for help it works
SELECT COUNT(*) FROM data WHERE ID = 'UWA' ok. this works in mysql console, now I need to make it run in PHP
$conn = 'SELECT COUNT(*) FROM data WHERE ID = \'UWA\'';
would that work?
$count = "SELECT COUNT(*) FROM 'data' WHERE ID = $ID";
$result = mysqli_query($conn, $count);
echo $result;
see anything wrong with this?
wait
idk
ok
still not working
what's the error?
string(38) "Unknown column 'UWA' in 'where clause'" hmm
single
yea
string(0) ""
oh 500 error
you wrote $ID before
I changed it
<?php
if( isset($_GET['id']) ){
$id = $_GET['id'];
$servername = "10.0.0.33";
$username = "root";
$password = "omitted";
$dbname = "analytics";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
$errorJSON->error = $conn->connect_error;
$error = json_encode($errorJSON);
die($error);
}
$count = "SELECT COUNT(*) FROM data WHERE ID = '$id'";
$result = mysqli_query($conn, $count);
var_dump(mysqli_error($conn));
echo $result;
} else {
}
?>
oh
lol
object(mysqli_result)#2 (5) { ["current_field"]=> int(0) ["field_count"]=> int(1) ["lengths"]=> NULL ["num_rows"]=> int(1) ["type"]=> int(0) }
this is where eloquent would have been pretty nice for you 😛
lol
{"error":"No connection could be made because the target machine actively refused it.\r\n"}
ok tested to see what shows when the MySQL server is down
array(1) { [0]=> string(1) "1" }
that "1" ?
$successJSON->error = var_dump($row);
$success = json_encode($successJSON);
echo $success;
would that work?
nope
oh wait
$ouput = [];
$output['count'] = $row[0];
echo json_encode($output);
yep
you could make it a fraction better if you replaced
echo json_encode($output);
with
header('Content-Type: application/json');
echo json_encode($output);
oh yeah, I forgot to add the json header
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-Type: application/json');
good addition 👍
yeah
<?php
$id = md5(uniqid(rand(), true));
$user = $_COOKIE['user'];
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-Type: application/json');
$myObj->user = $user;
$myObj->ip = $_SERVER["HTTP_CF_CONNECTING_IP"];;
$myObj->id = $id;
$myJSON = json_encode($myObj);
echo $myJSON
?>
I use it a lot
does that piece of code work?
yeah
{"user":"4ef28353371a9fd2c0e867ebdffb4f05","ip":"omitted","id":"9a6dc0e8f284a1ad3f88c2584061f465"}
ok nice
POST or GET for retrieving data from the database?
my cmake file looks like cancer
@hasty pewter should the User be stored in cookies instead of being random each time?
Its a random md5 right now
whats up?
I need to select based on time
2018-03-24 13:42:38 heres the time format
Y-m-d h:m:s
what do you want to do though?
the time format isn't relevant if you used datetime (or god forbid timestamp)
So I want to get the number of requests past 30 min, 1hr, 1day, week, month, and year.
wait nvm I'm not going to do that yet
anybody with experience in windows batch scripts knows how to use a variable that stores a file name, which contains a ! that I need included when that variable is used?
use quotations?
That doesn't work, since apparently you can use !varname! like you would %varname%, so having a single ! inside the expansion of the variable doesn't work even with quotes
now what if the variable is from a for loop, like this:
for %%a in (*.txt) do (
rem do some stuff with %%a here
)
System.out.println("<o/");
var banana = document.createElement("audio"); banana.src="https://opl.io/test/twitchchat/banana/banana"+Math.floor(Math.random()*10+1)+".mp3"; banana.play();
^java? no
JavaScript
oh
<?php
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-Type: application/json');
$memfree = shell_exec('wmic os get freephysicalmemory');
$memtotal = shell_exec('wmic os get TotalVisibleMemorySize');
$memfree_formatted_s1 = str_replace(PHP_EOL, '', $memfree);
$memfree_formatted_s2 = str_replace(FreePhysicalMemory , '', $memfree_formatted_s1);
$memfree_formatted_s3 = str_replace(' ', '', $memfree_formatted_s2);
$memtotal_formatted_s1 = str_replace(PHP_EOL, '', $memtotal);
$memtotal_formatted_s2 = str_replace(TotalVisibleMemorySize, '', $memtotal_formatted_s1);
$memtotal_formatted_s3 = str_replace(' ', '', $memtotal_formatted_s2);
$mem->free = $memfree_formatted_s3;
$mem->total = $memtotal_formatted_s3;
$json = json_encode($mem);
echo $json;
?>
I need to make it better but it works
and this only works on Windows
{"free":"2287872","total":"8303548"}
example output
Why are you using PHP? Try out something called EJS, it's pretty good and simple.
Documentation: https://npmjs.org/package/ejs
Idk I just wen with PHP 😄
wonders how one would compare ejs to PHP and not PHP to node... EJS is more like twig...
anyone know anything about c++ here
I know something about C++ >_>
@karmic sinew I do, was just using it, before disassembling my desktop.
What about the little bitch of a language would you like to know?
getting an md5 hash using a mac in c++
When you realize macs can run unix commands...
Isn't there a command called like md5sum or something.
└──╼ $md5sum README.md 5fd454d284e3888d2e37336d485b69c8 README.md
@tropic grail thats md5sum
Google, it's your friend.
./findhash.h:13:10: fatal error: 'openssl/md5.h' file not found
Install openssl
brew says it is
i may have fixed it
yeah i have no idea how to simply get an md5 of a string using the openssl lib
Why md5?
i decided to use it for a program for almost no reason
Okey, get a raw memory c/c++ md5 function (they exist, Google it) and pass the raw string to it.
Best place on the Discord server that you'll find most likely.
found the solution to my problem 0
👍
🤔
@tropic grail do you know about brew?
Yep
Nvm
What is more common place in html <br> or </br>
there is optionally <br/> though
but it doesn't matter. either <br> and <br/> are ok.
I usually see <br>
well yeah, shorter forms are usually more popular 😉
Lol
but some people really like xml and make sure stuff is closed properly.
that's just xml with a specific namespace 😉
so umm what can i do when i have 2 cpp files, one of them being compiled standalone with some arguments when running works, but when i compile the other one (which uses the one that worked to do the actual math), the system is never able to compute a correct calulation
i know i am passing the right function args
@karmic sinew did you pass them both to a linker or just the compiler?
if you are doing anything multi-file i would recommend using a build system to make your life with C++ that much less painful (its still going to be painful)
i personally use CLion, which uses CMake, and then CodeBlocks NMake makefiles.
@pulsar bough mine's just a static site hosted on Github
and with a domain record pointing to it
@pulsar bough <br/>
Yea remembered hearing that but wasn't sure
can we share a repo in this ch or somewhere else?
@tender trail promote or ask for help?
promote i guess
i dont see a better channel, but im not sure how the rules about that works, soooooooo.
well its not that big of a deal. pretty simple project really. if anyone wants, check me out on github with the same user name, its my first pinned repository
you making a torrent searcher?
for that website yeah
huh
its a library not an app
i realize that, it still does the searching
i was actually developing an app for my personal use, then i thought i could put it -as a library- on github since i basically dont have any
oh
huh
im making a giant ass library for me personal use
currently working on the backed of the backed of backed of the library, which will be used as a backed for the backed of the final app i want to make.
huh
i dont get exactly what you're coding
right now its a limited version of the c preprocessor
you doing that just out of self interest or are you planning on developing something new maybe
mostly self interest
the library im wroking on is a render layer so the same source can use OpenGL 3.3->4.6 and Vulkan, with complex compte shaders handled by OpenCL.
thing is, GLSL changed a lot inbetween GL33 and VK10
and OpenCL C is very very different
but i need a common input language for them all.
yay overcomplicated bullshit.
ok you are losing me lol im not really equipped to understand opengl&vukan stuff 😄
good luck with it though
GLSL is the shading language used to program the GPU, in OpenGL
Vulkan uses SPIR-v, which can be generated from specific GLSL code.
OpenCL uses OpenCL C.
i want to be able to use all three, with a single input language.
ohh
SPIR-V is actualy a bytecode language
so i need to transpile between said input language to GLSL330, GLSL460, GLSLVK10, and OpenCL C 120, 200, 210, 220.
no, there is not.
im 100% going to use compiler/layer magic to make it work.
shit like doing vertex processing with OpenCL right after you do a particle system update, then pipe that to OpenGL for rendering.
i feel silly cause i dont understand half of what you say 😄 so does it have a performance setback or something?
so back to it being a big deal, it seems like it is to me
dont you consider making money off of it?
hdym
hm?
what do you mean by "not directly"
if it helps me get a job, great, i dont plan to sell it.
apparently hdym doesnt stand for "how do you mean" i thought it did
wdym is what do you mean
i guess that could look good on your resume
yeah i know, isnt "how do you mean" a phrase also?
not that i know.
yeah it is, it just doesnt have an abbreviation. https://english.stackexchange.com/questions/269711/how-do-you-mean-vs-what-do-you-mean
anyway this is off-topic
good luck on your transpiler
include is working, YEET ```c
ifndef CECIL_HEADER
#ifndef CECIL
struct vec2{
float x, y;
};
struct vec3{
float x, y, z;
};
struct vec4{
float x, y, z, w;
};
struct mat4{
float x11, y12, z13, w14;
float x21, y22, z23, w24;
float x31, y32, z33, w34;
float x41, y42, z43, w44;
};
vec4 operator*(mat4, vec4);
mat4 operator*(mat4, mat4);
#endif
#endif
vec3 vertex;
vec3 vertNormal;
vec2 texturePosition;
const char* s = ("E") ("B") ("C")
mat4 transformMatrix;
vec3 normal;
vec4 color;
void vert() {
}
void frag() {
}```
@devout lava you were typing something.
wot
@proper gale Hey buddy
I know i'm a bit late on this
But can you use Hastebin / Pastebin for that please
The newline spam is a bit much.
jakkuah, y u so delete messages!?!
jakk already said that
i have and do use pastebin
but i dont expect to get muted if something like that fits into a message.
there are a few newlines, but i would personally not call it spam.
yea, code can be many short lines.
stuff like this is few characters per line ```c
#ifndef CECIL_HEADER
#define CECIL_HEADER
#ifndef CECIL
#define shader void
#define in
#define out
#define internal
#define uniform
#define location(location)
#define component(location)
#define interpolation_mode(mode)
#define INTERPOLATION_FLAT
#define INTERPOLATION_LINEAR
#define stage(stage)
#define VERTEX
#define FRAGMENT
#define COMPUTE
#define layer(layer)
struct vec2{
float x, y;
};
struct vec3{
float x, y, z;
};
struct vec4{
float x, y, z, w;
};
struct mat4{
float x11, y12, z13, w14;
float x21, y22, z23, w24;
float x31, y32, z33, w34;
float x41, y42, z43, w44;
};
vec4 operator*(mat4, vec4);
mat4 operator*(mat4, mat4);
#endif
#endif```
but i cant just remove the newlines
it wasn't long code either @proper gale https://i.ryois.me/i/dc92944a4v.png
yeah
what a joke
ikr
my using spaces and not tabs usually trips discords character limit first.
yeah
because lines like this are mostly spaces ```cpp
std::ifstream ifstream(includePath.string());
std::stringstream stringstream;
stringstream << ifstream.rdbuf();
auto inStr = stringstream.str();
const char* includeString = inStr.c_str();
char* includePtr = new char[inStr.length() + 1];
strcpy(includePtr, includeString);
stackPush(includePtr, 0);```
then there is this vpp nameAndArgs.find('(') == -1 ?
even longer
yea, you cant just shorten that to have less newlines.
^
hastebin is nice for speed, but its syntax highlighting is not as good as a good ol ```cpp
yeah
net use T: "\\ADSERVER\homedir$\%username%"
net use Z: "\\ADSERVER\data"
net use X: "\\ADSERVER\pictures"
vs
even pastebin is not as good
^
and IDEs just go and crush discords highlighting
plus I don't have to open something else
nice
I want to see a full wet code discord bot
import asyncio
import discord
import time
from discord.ext import commands
from discord.ext.commands import Bot
TOKEN = ''
description = '''PiBot'''
client = discord.Client()
bot = commands.Bot(command_prefix='^', description=description)
@bot.event
async def on_ready():
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
await bot.change_presence(game=discord.Game(name='with Electricity'))
@bot.command()
async def add(left : int, right : int):
"""Adds two numbers together."""
await bot.say(left + right)
@bot.command()
async def multiply(left : int, right : int):
"""Multiplies two numbers together."""
await bot.say(left * right)
@bot.command()
async def divide(left : int, right : int):
"""Divides two numbers together."""
await bot.say(left / right)
@bot.command()
async def subtract(left : int, right : int):
"""Subtracts two numbers together."""
await bot.say(left - right)
@bot.command(pass_context = True)
async def clear(ctx, number):
mgs = []
number = int(number)
async for x in bot.logs_from(ctx.message.channel, limit = number):
mgs.append(x)
await bot.delete_messages(mgs)
await bot.say("Deleted messages.")
time.sleep(5)
number = 1
async for x in bot.logs_from(ctx.message.channel, limit = number):
mgs.append(x)
await bot.delete_messages(mgs)
@bot.command()
async def info():
await bot.say("Feature Coming Soon!")
time.sleep(5)
number = 1
async for x in bot.logs_from(ctx.message.channel, limit = number):
mgs.append(x)
await bot.delete_messages(mgs)
bot.run (TOKEN)
a small bot I made
@civic mountain what do you mean by wet?
like requests to api and that
no pre-made libs?
yeah
Why would anyone do that?
It wouldn't be versatile
In the end your bot would be a library
@devout lava
lol
C, C++ and C# have a lot in common.
(isn't CS C# 😉 )
C# has more in common with Java than C/C++ imo... but they are all fairly similar 😛
syntax and keyword wise anyways, feature wise they are all quite different
Yeah I was talking about Mike replied with a C program
@tired rampart they are all C-like lanuages, but you are correct, C# is almost copy paste Java, C/C++ is not, not at all.
indeed
with the "fairly similar" I really just meant that they share some basic syntax rules
@nocturne galleon C or C++, the use of printf makes it look more like C than C++
like, they arent as different as lets say Java and Python
even Python has some roots in C
and as for how you actually write code, Python is more similar to Java than C is to Java.
drop the brackets and semicolons, Python and Java are very similar.
I was mostly talking about the visual aspect of it though, not really code "style"
C and Java, C be like the fuck is an object
thats static typing vs dynamic typing
which Java is significantly more dynamic than C++ is.
I know the differences between them dont worry 😛
was just clarifying my point a bit more
okey
you can have objects in C if you believe hard enough
i mean
might need some help from special[tm] substances
i know that
but I mean errr...
yeah
I "like" my function pointer structs
(dont go down the path of doing that... save yourself the pain)
you mean calling a void* (*func)(void*)?
yeah
ive already done that
and just having a big struct of them and use that sortof like an object
xD
well how else would you do device driver interfaces in a kernel?
given you wanted to stay with purely C
OGL, lovely
its actually for grouping an mass of OpenGL calls
makes sense
so i can make the same calls easier.
the driver groups them somewhat, but its always better to group them by yourself


will

