#development
1 messages · Page 72 of 1
You can lock it down however you want
i dont mean to call you out, but your timeline is very unrealistic
i'm not planning on creating full fledged custom distro, just a freaking ubuntu with Plasma KDE and custom theme and my programs
thats all
why do you need a custom theme tho
nah that will be the last
i understand security tweaks
i want to make it more intutive
or i might just take
existing theme
and put my logo on start
😂
probably
yeah you could do that
xd
it would be a lot easier
true
but i have a designer
in team
so
thats covered
i'll probably
just take existing theme
and put my logo
for right now just focus on your infrastructure
yeah i know
fuck the theme
🤣
i'll also probably be able to test it in school enviroment
AKA in my school
for beta testing
i imagine there will be a lot of bugs
lol
the thing is i don't have a real deadline
and i'm working on few other projects
so its not TOP TOP priority
basiclly what i'll do is take Ubuntu Desktop, put Plasma KDE take some theme put my logo, install my programs and be done
i think thats reasonable
I think visual flare is less important during this phase
i'll do the theme at the end
then why are you talking about it now? xD
because.....
my hands are going too fast
the same with HDDs
their capacity is increasing
but their speed is same
lol
I see. Good Coffee™️
:rofk:
🤣
Soon TM
🤣
which OS is better in terms of how its built and made? Windows or Linux?
i heard EXT4 is better than NTFS
personally i like linux's system more
linux is better objectively.
stable release cycles, runs on anything, works with anything, and its highly modular
windows has a lot of settings as software code
linux has these configurations and tuning/tweaks baked right into the machine code
all of these settings are done before compilation
^ all of this, plus linux doesnt treat c as a second-class citizen
and in general programming low-level on windows is painful
@spring pond yeah couple lines of C yields a runnable program
and the everything is a file principle works out really well
plus its free and you can easily modify it to suit your needs
free to modify and such yes
Wsl on the other hand, perfect as soon as you install it
Wsl is a mess
So here we can talk about code?
no, we talk about cats
but what if the cats can do code? 🤔
ive never had an actual problem with wsl for what I do
which tbf is pretty much just building java python and c stuff
I saw somewhere there's no write caching
or some sort of cache anyway and disk I/O is slooooow
For me that isnt really a problem for the reasons above
Even if i read and write to disk its not large enough to matter
WSL1 or 2?
2 I've never had any issues with, because it's just a virtual machine basically.
I tried both
and gave up
last time I tried it was a year ago
it works sort of
but I just use my linux laptop, much easier.
feels wrong to run a linux vm on windows
idk if i have always used wsl2 or if i switched at some point
but ive never had a problem
I've only used it to ssh into my home server. So really can't comment on it.
has anyone used treehouse to learn anything?
no
whats th at haha
I've seen it, and I can't say I recommend it for more than just learning the syntax of a language to get you started.
I am a firm believer in learning-by-doing, and more importantly, leaning by trial by fire.
Coding "bootcamps" imo just throw three thousand different things about a language "oh look this is cool!" without ever showing you how to use it, or how to think for yourself how to connect things together.
I think it's far more valuable to just run through a few quick tutorials on how to use the basics of a language, then try to make something in that language. You will invariably immediately run into problems and things you don't know, so that's when you start using Google to search for how you might solve X issue
Now, I KNOW that you can learn a lot of bad practices in this way, especially with older languages like C++ with LOTS of footguns in which you can shoot yourself in. But IMO, building the skills of how to have an idea, design a solution, translate problems into Google queries, and piece all the parts together is FAR more important and useful than knowing the syntax and best practices of a language. Best practices can always be learned later.
ok, rant over from such a simple question lol.
@last ingot performance issues.
I also had issues with some of the block device tools
low level kernel functions do not work, or are not fully implemented
disk partitioning tools on WSL? forget it.
ok
@last ingot If I need a linux environment, I just use my laptop
even when working on my desktop, I can just use ssh
installing a VM just to be able to use linux tools on windows is so backwards
Hey guys
Supp
I'm here to ask
Is there anyone can explain what is compiler and the relation between the compiler and the assembly and the complicated programming language ( i already know something but I'm making sure that it's clear for me
I google'd it but I'm kinda out of mana)
the compiler turns source code into assembly code which is then assembled and linked with any other libraries into an executable
im describing the c++ compiler but other low-level languages work similarly
thx .
but
i meant the full process
and ik that every high level language has it own compiler but what is the full process that happening to the high level language to make it assembly then machine language
@rapid sable compiler theory is a lot more complicated
In this video, I compare a simple C program with the compiled machine code of that program.
Support me on Patreon: https://www.patreon.com/beneater
@rapid sable the first compilers were written in assembly
back then they would be called macro assemblers
C compilers these days are self hosting. Meaning the compiler for C, is written in C.
@rapid sable the compiler outputs an ELF format. Which can then be used by a linker to link memory addresses of system calls to the program
functions like malloc() that are provided by the operating system may not always be in the same memory location
a simple statement like x + 1 is relatively simple in machine code
x is loaded from memory into a special purpose register
1 is then loaded into another special purpose register
and the add opcode is used to add these two registers together
the output is then read from the register and written to memory somewhere
the opcodes, registers and such are different between different processor architectures
thats why compilers were invented in the first place.
A program written in C, can be compiled for a wide range of architectures
This ^ doesnt hold true for all programming languages
Certain languages like Java and .NET use an intermediate language
Other languages like python and javascript are interpreted. but people have written compilers for these as well
Compilers themselves usually follow a similair architecture
Compilers build an abstract syntax tree
the compiler then generates assembly for each block
There's various steps involved in this
I've only ever written a compiler for a custom language extension to CSS
but its similar
I used this in the past: https://www.antlr.org/
ANTLR is a parser generator
You provide it with the grammar of your language, and it generates a parser and classes that represent your AST
That's a nice website
Thx bro <3
@dim lava quite a few modern query languages have been built with ANTLR
you can just get the grammar file for ANSI SQL
and start modifying it
love it
@dim lava lemme see if I can find some example code I had
Hey im need to make some homework for school. Im currently working on a project in processing and are only allowed to use methodes. Is there someone who can help me 😄
DMs are open if you can help me
made a quick and dirty "enhanced touch" tool, basically templates but for the commandline https://github.com/sebastiansam55/etouch
hello, i have used wix for 8 months, still got no idea what im doing, and have restarted projects like 30 times - im slowly figuring it out
my main question is tho, i have lots of people saying "eww, wix, why not <insert_name_here> instead?!!"
so today decided to google trends some heavy hitters and uh, should i actually NOT be using Wix?
my use case is : store, forum, downloads, chat, support, blog posts
my biggest issue is that wix doesn't offer "automatic key delivery" on products, for example if i was selling digital copies of something and needed to give a customer a product code, wix doesn't seem to allow this delivery method, unless you make it a file, but then that's a single file for all orders, instead of unique
which has me actually looking at alternatives
I have used "shoppy.gg" as my method of automatic key delivery, and ill be honest with you, its a free platform that does everything i need, and some things i want
but im looking for that ultimate soluotion of automatic delivery, drag and drop editor, RESPONSIVE (wix is ungodly unresponsive) and seemingly lowcost
would anyone know if squarespace allows automatic delivery, or shopify? maybe there's another site
there exist a whole myriad of these solutions
a turnkey solution for them, is often more difficult. and will require either some integration or programming to deploy
Another often overlooked webstore platform is Magento
This falls under Development right?
So this exists hidden within the latest "Alpha Skip Ahead" Xbox Insider OS Build.
https://twitter.com/PH96_Official/status/1372963232911142918?s=19
Hey y'all, is anyone familiar with spark?
What would be the fastest way to get adjacent cells to do a reduce on?
So for example I have data like this:
((coordx, coordy), Key: Value)
The data is in a grid and I want to get the sum of values of a key from all surrounding coords of coordx and coordy.
not sure I quite understand that data layout.. is that a tuple or something?
or is there a key/value for each coord?
should i use compound views in android instead of one big xml file ? i currently building a product listing details page
Any minecraft modder who would like to team up on new modpack for modern minecraft version ? after the caves update ?
dm me
Hello, 👋 Does anybody how do I check if an instance, from a specific class in C++?
c++ has no method to directly check class membership (and you should try to avoid situations where you have to do so). however, you can check if one class is derived from another using std::is_base_of
I was looking at that, but I have to pass the Class itself not the instance
can you give me a code snippet of what you're trying to do
template<typename Dog, typename T>
inline bool instanceof(const T*) {
return std::is_base_of<Dog, T>::value;
}
int main(){
Dog viv;
Chiguagua tom;
Chiguagua lun;
Rodwaller nek;
viv.setDogName("Viviana");
tom.setDogName("Luna");
lun.setDogName("Tom");
nek.setDogName("Neko");
std::list<Dog> allAnimals;
allAnimals.push_front(viv);
allAnimals.push_front(tom);
allAnimals.push_front(lun);
allAnimals.push_front(nek);
std::list<Dog>::iterator it;
for (it = allAnimals.begin(); it != allAnimals.end(); it++)
{
if (instanceof(it))
{
/* code */
}
}
}
Is a assignment about polymorphism, so I'm trying to check if the instance in the list is from a specific class.
formatting
template<typename Dog, typename T>
inline bool instanceof(const T) {
return std::is_base_of<Dog, T>::value;
}
int main(){
Dog viv;
Chiguagua tom;
Chiguagua lun;
Rodwaller nek;
viv.setDogName("Viviana");
tom.setDogName("Luna");
lun.setDogName("Tom");
nek.setDogName("Neko");
std::list<Dog> allAnimals;
allAnimals.push_front(viv);
allAnimals.push_front(tom);
allAnimals.push_front(lun);
allAnimals.push_front(nek);
std::list<Dog>::iterator it;
for (it = allAnimals.begin(); it != allAnimals.end(); it++)
{
if (instanceof(it))
{
/ code */
}
}
}
@ruby aurora if you're allowed to use pointers im dumb you can use regular objects too you could try dynamic casting all of the objects to dog and checking its success
that would work for both members and derivations of the class
actually it looks like you can use regular objects too
Ok, Thanks! I will try it out
hello
try:
main2 = WebDriverWait(driver, 120).until(
EC.presence_of_element_located((By.XPATH, ".//body[@id='tinymce']")))
print(main2.text)
desc = driver.find_element_by_xpath(".//body[@id='tinymice']")
some1 knows why this give me a stale element error ?
this is right after opening a new tab
Somebody knows why this isn't working?
function findOne(queryObject) {
let l;
MongoClient.connect(url, function (err, db) {
if(err) throw err;
const appStoreDB = db.db(appStoreDBName);
appStoreDB.collection('applications').findOne(queryObject, function (err, result) {
if(err) throw err;
//debug.log(result);
this.l = result;
db.close();
});
});
return l;
}
It doesn't return result value, it returns undefined
that's not how callbacks work
wdym?
findOne returns before the code you called has even executed
its asynchronous
welcome to javascript.
you mean sync?
welp, then how can i make it work?
I like to use async
@midnight wind he's passing functions into the client
they are called once the result has been fetched from the db
but it doesnt block the method
your current execution context will just go to the next line, and do return l;
which is still undefined at that point
i see
callback functions are passed in the function defenition whatever it's called
I prefer coding in typescript
like
callback;
}```?
@midnight wind yeah, usually
yeah that's my understanding
you can do await though I dont know so much about the javascript specifics
I prefer using typescript
because it takes care of most of the nuisances when it comes to writing async code
await someFunctionCall()
will block execution until a promise is resolveable
await needs to be called inside a async function
function resolveAfter2Seconds(x) {
return new Promise(resolve => {
setTimeout(() => {
resolve(x);
}, 2000);
});
}
async function f1() {
var x = await resolveAfter2Seconds(10);
console.log(x); // 10
}
f1();
your database call can return a promise
which you should, because the nature of the library expects this
global await has been proposed but not implemented
async function findOne(queryObject) {
let l;
MongoClient.connect(url, function (err, db) {
if(err) throw err;
const appStoreDB = db.db(appStoreDBName);
appStoreDB.collection('applications').findOne(queryObject, function (err, result) {
if(err) throw err;
//debug.log(result);
this.l = result;
db.close();
});
});
return l;
}
this?
not quite
async does nothing, you need awaits
await, waits for it to do things
no he doesnt
same function will be called
@fleet geyser remove the l variable
@fleet geyser and inside your inner function you return a promise
mark your function as async
okay i already did that
might actually not be the right way to do it in js
Im so used to TS
functional programming breaks my brain ;-;
async function findOne(queryObject) {
var l;
try{
client = MongoClient.connect(url);
db = client.db(appStoreDBName);
l = await db.collection('applications').findOne(queryObject);
}
catch(e){
throw e;
}
finally{
db.close();
return l;
}
}```
shouldn't this work?
this isnt java
?
no it doesn't work
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:27017/";
MongoClient.connect(url, function(err, db) {
if (err) throw err;
var dbo = db.db("mydb");
var myquery = { address: /^O/ };
dbo.collection("customers").deleteMany(myquery, function(err, obj) {
if (err) throw err;
console.log(obj.result.n + " document(s) deleted");
db.close();
});
});
you just check if err is set or not
no try catch
yeah
if its null then there's no error
if it isn't null then therei s
if experienced dev can't solve this then idk how i should LOL
@fleet geyser the idea is instead of returning a value, you pass a function which you call once it has resolved the database information
promises do it the other way around
my js knowledge is serviceable at best
typescript is just easier
i could always switch to it LOL
const myAsynFunction = async (url: string): Promise<T> => {
const { data } = await fetch(url)
return data
}
const immediatelyResolvedPromise = (url: string) => {
const resultPromise = new Promise((resolve, reject) => {
resolve(fetch(url))
})
return resultPromise
}
typescript promises ^
@fleet geyser might be a good idea to try and learn js async before you do this
@fleet geyser what you need to get your head around is that javascript doesnt have a threading model you can influence
everything is asynchronous
if a function you call, does something asynchronously, your code that calls it can either, also be asynchronous
or
await a function call
it will halt, and continue execution once the other callbacks have returned
async function findOne(queryObject) {
MongoClient.connect(url, function (err, db) {
if(err) throw err;
const appStoreDB = db.db(appStoreDBName);
appStoreDB.collection('applications').findOne(queryObject, function (err, result) {
if(err) throw err;
//debug.log(result);
db.close();
return result;
});
});
}
where here should i put await?
i'm making an app store for SchoolOS using Electron
Xd
can't i just put an await
?
whereever i put it, it says: await can only be used in an async function
but that function is async
so why it throws that error?
it's not though
you created a callback function inside Monoclient.connect
that's not async
oh yeah
const db = await MongoClient.connect(url);
const collection = db.collection("MyCollection");
const result = await collection.find(query).toArray();
return result;
something like this might do
if you put this inside a method
make sure you mark it as async
yeah
yeah i figured it out
but I always thought you should have try, catch
this is just happy flow rn
async function findOne(queryObject) {
await MongoClient.connect(url, async function (err, db) {
if(err) throw err;
const appStoreDB = await db.db(appStoreDBName);
await appStoreDB.collection('applications').findOne(queryObject, function (err, result) {
if(err) throw err;
//debug.log(result);
db.close();
return result;
});
});
}
so something like this?
stop nesting.
you dont need nesting
you are using await
it resolves the result if you do await
you don't need to pass a function like that
yeah the whole point is so you don't need callbacks
javascript is pure cancer
sorry to say
the entire ecosystem and language is a bit of a mess
its just a bunch of hippie web developers pushing it very hard
and its being used everywhere now
@fleet geyser if it is just for fun
try typescript
TypeScript extends JavaScript by adding types to the language. TypeScript speeds up your development experience by catching errors and providing fixes before you even run your code.
well kinda
it works with anything that runs with javascript
it isn't just for fun
the language is kinda smoother to use
so if i just change file name from .js to .ts
you can create objects more easily
it will work?
doesn't it compile to js?
yes it does
it transpiles to javascript
@midnight wind I didnt know jack about javascript
but my final project to graduate was at this one ecommerce company I got an internship at
just before the pandemic
and in 2 weeks I learned typescript, and set up a complicated project with it, using various language tools and concepts
typescript has types
which means, you get compiler awareness and enhanced error detection
@fleet geyser what program are you using to write ?
I assume visual studio code?
typescript works brilliantly with it
all you need is the ts-node and a ts-config.json
one is the compiler and the other is the settings for the compiler
I can give you some template files
hold on
I use webstorm personally
but thats cus I am a slave to jetbrains, I just love their IDE's
Yeah me too, I have everything in Toolbox
So its just easier agagaghahaa
And I prefer WebStorm over VSC, cuz it has better Tab Space suggestions agaghaghahg
done stuff like this in typescript
import m from "mithril"
import render from "mithril-node-render"
import { UmbracoClient } from "umb-template-common/dist/heartcore"
import { defaultPath } from "umb-template-common/dist/default"
export const renderComponent = async <T>(component, content: T, client: UmbracoClient) =>
({
rendered: await render({ view: v => m(component, { content }) }),
content: {...content, culture: client.getCulture(), project: client.getProject(), root: defaultPath }
})
I used mithril, a single page application framework
I'm using Electron
but I wired my own tools around it
which is installed using Node JS and NPM
to work with a headless CMS called Umbraco Heartcore
with built in webserver
and schema synchronization
So shouldn't I use:
const electron = require('something);
url routing
instead of import?
u
h
i mean, this isn't just for fun so i don't have that much time to learn new things every time
i think you were the one who critized me when i talked here about creating eschool solution
app.ts:
//Prepare webserver
const app = express()
const port = 3000
app.use(session({
cookie: {maxAge: 86400000},
store: new (MemoryStore(session))({ checkPeriod: 86400000 }),
saveUninitialized: true,
resave: false,
secret: "super secret",
genid: req => v4(),
}))
//Prepare router
const router = new UmbracoRouter(app, getClient, "/home")
globalThis.sessions = Map
//Create template engine context
const hbs = exphbs.create({ extname: "hbs", helpers: { json: x => new hbs.handlebars.SafeString(JSON.stringify(x)) } })
app.set("view engine", "handlebars")
app.set("views", path.join(__dirname, "/../src/view"))
app.engine("handlebars", hbs.engine)
//Expose static application files
app.use(express.static("src/public/"))
app.use("/dist", express.static("dist/"))
//Begin application code for umbraco routed types
registerRoutes(router)
app.listen(port, () => console.log(`server is listening on ${port}`))
app.ts is equivalent to your index.js
yeah
not index.js default
yeah you can choose that
I just have
{
"name": "umb-template-client",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "ts-node src/app.ts",
"build:webpack": "webpack --mode=production",
"watch:webpack": "webpack --mode=development --watch"
},
...
in my package json
right now i have a problem with the fix you suggested up there:
async function findOne(queryObject) {
const appStoreDB = await MongoClient.connect(url);
return await appStoreDB.collection('applications').findOne(queryObject).toArray();
}
when i put await before MongoClient.... it says .collection method doesn't exist
okay
use a debugger to see that's in appStoreDB
that's what I do
wdym?
connect a nodejs debugger
and set a breakpoint
so you can inspect the value of appStoreDB
i know .collection method is in that variable/class
yeah then its undefined
hm
no you're doing it wrong
@fleet geyser collection doesnt return a promise
do you do that on a seperate line
https://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html
Connect doesn't return anything
collection isnt async
@gray flume that document isnt helpful
I read that one already
it just uses callbacks
async function findOne(queryObject) {
const appStoreDB = await MongoClient.connect(url);
const applicationsCollection = appStoreDB.collection('applications');
const result = applicationsCollection.findOne(queryObject);
return result;
}
it still says .collection doesn't exist
put a breakpoint on the 2nd line in the method
see what appstoredb holds
this right here, this is why I hate javascript
because every single library has their own way of doing things
and its always a mess
something like this?
yes
Yeah, then run it so you can inspect the appStoreDB variable's contents
@warm sleet Lol, the problem with JS is it's low barrier of entry & rapid growth of the Node ecosystem that lead to tons of scattering and low-quality OSS.
agaghaahgahga
people complain about its verbosity
lol
you mean the program, right?
@fleet geyser click on the green bug next to the run button
program will halt at that point
Types are great and everyone that disagrees is masochistic IMO lol
I use terminal to run the program
Inb4 assembly types
npm start
@gray flume you can always store them in Object[] where all is equal
Oh god please no ;_;
@fleet geyser click on the run configurations button at the top
add a new run configuration
select NodeJS
i already have run configuration
Yeah, so use that to run your application
run it with debugging enabled
it will break at that point
@gray flume ever tried debugging php?
their methods have side effects :D
Haha, as a Java dev, you're probably going to hate this, but: I'm primarily a PHP dev 😛
lol
@gray flume I've done my share of PHP
What do you mean with side-effects? 😆
hm
just, json_decode
GHAHGAGAGHAHGAGH
Ahh, right.. yeah, those methods are ugh
I 10000% avoid using those directly, and instead use wrappers for it that 'normalize' the behaviour.. throw an exception if it's invalid like a proper language, lol.
@gray flume https://i.imgur.com/NsntHoL.png
That said, a lot's been improving over the last 2-3 years, though.
7 years ago
I started coding seriously in java
wrote a multi server project for a roleplay server
provides synchronization across 7 minecraft servers, provides chat, discord integration as well as a whole bunch of custom stuff
supports code reloads while the game is running :3
classloader magic
oh, its minecraft btw
if it wasnt obvious yet
Haha, yeah, Java's pretty nice in a lot of aspects
I still really really passionately hate Maven though
maven is great xd
It's weird in it's behaviour
You should just have a single package file with constraints like it has, and that should be sufficient for it to instantly gather all dependencies
its the ONLY package manager I've come across that perfectly handles modular builds
across a repository
I don't know, maybe I've just been doing it wrong, but that's the only thing that I've really really disliked about it
@gray flume we have like 120 projects on our minecraft git server
and they all integrate with one another
Go / Python / C / ObjectiveC / C++ etc. all do it just fine, but Maven? ugh.
dependency management is just so nice
Java and Maven = and they lived happyly forever
ugh tell me about it
maven isnt build to any one language
Apache's docs about any of their prodcuts = sucks
Gradle has one major problem
Yeah, I know, but it's the only I had to use with Java 😛
its SLOW. SLOW af.
Fucking gradle daemon turns anything into an oven
@gray flume I just have a master POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.knockturnmc</groupId>
<artifactId>knockturn</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Knockturn</name>
<description>Core plugins of KnockturnMC</description>
<modules>
<module>core-api</module>
<module>knockturn-chat</module>
<module>knockturn-core</module>
<module>knockturn-proxy</module>
<module>service-api</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Yeahs, that should definitely be sufficient
and your individual modules then have two choices
they can either inherit the pom from their parent
or use their own
but for some reason, whenever I tell VS or whatever to install modules, it sometimes installs them but still doesn't compile due to missing references or some garbage
and then sometimes when you remove them, your IDE just goes "ya now i got them" and you basically go WTF
and then as you manually install/link it because 'fuck it just compile already' it just corrupts the everything and I'm just done with it all lol
Yeah, I mean, like I said, I'm probably just doing it wrong
Either that or everyone else is doing it wrong
I had this odd issue before
where the IDE was using a different directory for the maven modules
and the odds of that being true is like, non-existent 😛
and then you run into all kinds of strange behaviors
where it compiles
but IDE be like: cant find library
Hehe, well, next time I need to compile a Java project and can't get it running, I'll let you know
oh. seems the other guys who help me maintain it now, went for java 1.14
interesting
I dont have that compiler
Until that time, I'm fine maintaining my own OSS projects, as that's already eating up enough of my time 🙂
@gray flume if you ever need some help with maven xD
you have but to ask
I've been using it for a long time now
@gray flume
https://i.imgur.com/MgZIFHY.png
Seems to me like your runtime can't locate your requirements/dependencies for some reason? Or does your app do this when running it normally too?
deploying binaries with maven is also very easy, you just do mvn deploy
when i use npm start it works just fine
With PHP it's even easier: you just tag the release and packagist.org picks it up 😎
Yeah, so, what if you try to instead return a custom object so you can see what's in the appStoreDB object? Or something like console.log(typeof appStoreDB, appStoreDB) and see what you get? My bet's your get object and null or undefined twice.
Haha, OSS is pretty much 80% of my day
I'm a core maintainer on https://inertiajs.com
most asked question on stackoverflow:
guys I have some problem
<insert long convoluted explanation and a snippet of code
*> undefined
same with the java section on SO
OSS Q&A is terrible haha
bunch of people trying to sell their NullPointerExceptions
@gray flume sometimes its useful because people include examples
so I try to derive some understanding from it
Yeah, I mean, it's not all bad
just copy pasting from SO and expecting it to work, is not the way
it's still people investing their time into answering random questions
but, some to most of the questions are just stupid
that's what filters are for
you weed out the bad
if its a question many have had
there's usually an upvoted thread
if it shows results: 0
you have some digging to do
@gray flume I recently wrote a software generator for this one company
it built a stub application for a mithril project that used Umbraco as headless CMS
its interesting what is possible with node. I could do pre-rendering on the server
Yeah, SSR is pretty cool
and then return a document, mount it on the client. And you have near-instant load times
any further pageclick you do
is directly from the Azure CDN
it only loads snippets of js from the application server
never used webpack before, but its neat
Yeah, it's a decent way to pack up your application
@gray flume the entire page structure of umbraco was based on urls
same thing with 'code splitting'.. it's a bit more difficult, but it really allows for creating load-as-you-need js files automatically
so I customized the router from mithril to work with the CDN directly
the CDN returns a document for a given URL
I then look at the type, and select the right controller/view to render
including all the fancy multilingual support that you need on the web
they use mithril as their framework for building the pages
their current stack is MVC (ASP.NET)
with mithril bolted onto it
they have a microservice to do the prendering, its a mess
this just builds it into a single instance, that can be scaled up easily
Yeah, I don't really like Mithril 😛
Yeah, I get it, but, like, you still have to write an API to feed your page data
Sure, you can use SSR to pre-render it, but for all other calls you still need your API
@gray flume you dont :D
this was in a corporate setting
using this ^
Its a CMS
with a rest and graphql api
the client was built into the page routing
and view logic
so in the local scope you always have the right language settings
and can immediately start fetching data
I don't think I'm following
in your client-side Mithril.js app, you still need to fetch data from an API, right?
@gray flume I built an MVC structure with this, using umbraco for routing
@gray flume ye, it uses the umbraco api
Yeah, exactly
yeah but that is built into the page routing itself
Well, okay, so, maybe you don't need to maintain the api then because they do it for you
so when you load /home/about
but you still need an API which is ugh
Ah, right.. it recognizes teh request is not a regular visit and returns JSON/whatever?
yeah its json
I use typescript, and the graphql's schema ability to have a type reference
Yeah, gotcha.. that's pretty neat, yup
Inertia's pretty different.. we render a JS-app based on server-side variables, and use the server side's routing 100% of the way
so you can enter your CMS configuration
and it generates an entire project
server, spa (webpack) and a CMS client module
Meaning, no state management on the client.. no need to handle sessions/redirects client-sided if you're logged out for some reason etc.
Anyway, time for dinner, gotta run.
@gray flume yeah I handled routing through the API from the CDN
I just had to do a route match to the type of the returned document
Yeah, for Inertia that's not necessary 🙂 The only thing that the client-side does is rendering of state provided by the server
yeah... mithril is tiny
like 4KB, after it loads
it doesnt hit the app server at all
it just hits azure
hold on, lemme grab a pic
@gray flume https://i.imgur.com/aui0Yqd.png
the whole reason it had to use SSR had to do with SEO
Yeah, that's primarily the reason to use SSR to be honest
Culture = white-labelled application / house style?
@gray flume language
We're in europe here, so you often need a couple languages on your site
@gray flume https://i.imgur.com/Obyl7NF.png
most basic of examples
@gray flume initially they wanted me to write a proof of concept application with this
when I saw this: https://i.imgur.com/4et7VW6.png
^ this is from the research doc I wrote
this sparked the idea: oh I can build a framework with this.
huge diffrerence on my improved code 😂
how much did it take you to reach that point
it's just putting the repeated code in to functions, though I would debate the wisdom of using the .table selector to assume all elements are what he's looking for.
huge diffrerence on my improved code 😂
@gaunt finch we all love boilerplate code ❤️
yet the old mess was written in a hurry and lazy way
old code is always written in a hurry, on the basis of "I'll come back and fix it later"
This never occurs.
vim or emacs
The One that works for you.
It's strange because although Eclipse uses all emacs shortcuts, I still use vi when on nix.
hi when i run docker buildx build --platform linux/amd64,linux/arm64 . for my python 3.8 container i get this weird error with pip install https://pastebin.com/zquD01GG
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
what's the base image, or how have you built/installed python in to it? is it FROM python:3.8 ?
This seems to be something that's happened before affecting nearly everyone with a broken SSL certificate. I've had the same thing with node/npm in the past too.
The general theme of people seeing that problem seems to be solutions such as:
`It works if I add the --no-use-pep517 option:
python3 -m pip download --no-binary=:all: --no-use-pep517 scipy==1.4.1`
Your productivity will take a nosedive moving to an OS you're not familiar with.
WSL and Docker have been a huge part of my workflow since they became commonplace. No more do I need another linux VM always there to do certain tasks, it means I can just always have a linux container available running whatever specific CLI tools I want.
So try it under a VM
If you don't have a specific reason to use one particular distro, just use Ubuntu or Ubuntu LTS.
here is my dockerfile https://pastebin.com/DUd99k3F I used python3 -m pip download --no-binary=:all: --no-use-pep517 -r requirements.txt and got the same result just on the arm64 build
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
ummmmmmmm... ubuntu and fedora are gnu/linux distributions. here is a good explanation https://www.pcmag.com/news/what-is-gnulinux
saying you think Ubuntu is better than gnu/linux is like saying a 3080 is better than a graphics card
Ubuntu and fedora are Gnu/Linux
yep lol
that seemed like it's "for" with the f dropped though, maybe just misspelling
I need a weekend project. Would anyone recommend building a Linux From Scratch system?
it's not just as simple as ./configure; make install; make bzImage anymore?
heyo robots
I'm looking for some text processing tools. My goal is to identify whenever one or more terms is present in a string (e.g. identifying if a message has the word "omelette" in it).
The basic thing to do is to check if message contains term, each of those brought to the same case (lower or upper)
I am looking for a library with more fuzzy logic, where, for example: if I'm looking for "omelette" I also get "omelete"
I've found apache lucene for java that sort of does this kind of thing, but it's a bit steep, still trying to understand it's documentation
@next ember https://medium.com/data-science-in-your-pocket/phonetics-based-fuzzy-string-matching-algorithms-8399aea04718
most of these fuzzy algorithms use some form of levenstein distance calculation
phonetics are nice because they allow for things to be misspelled.
regular expressions also allow some level of fuzzyness, depending on what flags you use
I was talking About trying to build a complete system. Including everything. Building the Linux kernel is a bit different than how you described it now. You use make mrproper to make sensible defaults if you are on the target machine, make menu-config to configure the kernel, and make to build the kernel. Different kernels have different file names because of how that are compressed or not.
on debian you can use make-kpkg
that creates a kernel package
make-kpkg --rootcmd fakeroot -j 4 --initrd linux_image linux_headers
I don't know what make-kpkg is, but you can make a deb package by doing a make deb-pkg to make debian packages and there is something similar for rpm.
@rancid nimbus https://i.imgur.com/E78QzqM.png
You can use this to build the distro kernel for debian and ubuntu systems
@pliant siren if you need an entirely custom linux environment. Take a look at buildroot https://buildroot.org/
Its ment for embedded linux, where you can tailor the kernel to exactly your requirements
I wonder if there is actually a typing/editing speed difference on emacs/vim/GUI editors with experienced users of the softwares
I have a suspicion it might actually just be super similar once you get used to it
at the end of the day its just a text editor
I much prefer my IDE over any other text editor
not directly related to development but does anyone know how to bypass user access control on windows
if the IT admin doesn't want you to do that, don't
wut
It is in the United States. Additionally, this server is partnered and must uphold the Discord ToS.
hacking itself isn't illegal
it's accessing systems unauthorized that is illegal
tbh hacking is a very broad term
Hacking in the traditional computer sense is coding. Hacking used today, falls under unauthorized access.
kinda not really, you can hack into your own security camera. That's hacking but you own it and therefore you authorized yourself
or penetration testers
they get permission from the company
That’s authorized access.
yeah but it's still hacking
So we’ve come to the conclusion that hacking can be legal or illegal, correct?
yeah
@empty sentinel when I modify electronics I've bought to do something that was never intended with it
that's defined as hacking.
same term lends itself to digital electronics: computers
Hacking something means doing something with it that the manufacturer never intended it to do
Breaking into systems that you do not have authorization for is called cracking.
cracking IS illegal.
I mean, if we really want to go into the muddy details, no, hacking doesn't necessarily lend itself to computers. I can hack something together (cobble something together), or I can hack away at a log.
cyber security can invent all kinds of words to detail the exact specifics of a type of access. But to the general populace, there's no need to go in to that much specific detail.
@empty sentinel no, this is historical.
Free phone calls were done by the technology freaks
calling it Phreaking, the ph for phone.
Hacking as a word lends itself as a derivation on phone hacking
https://en.wikipedia.org/wiki/Jargon "Jargon is normally employed in a particular communicative context and may not be well understood outside that context."
Jargon is the specialized terminology associated with a particular field or area of activity. Jargon is normally employed in a particular communicative context and may not be well understood outside that context. The context is usually a particular occupation (that is, a certain trade, profession, vernacular or academic field), but any ingroup c...
Hacking isnt jargon anymore.
Its a formal word. though I wouldnt use that when you ever go to testify
I would call myself an offensive security researcher.
It's the word known to the general populace for "unauthorized access". I agree that using the term in a courtroom, where specific meaning and details are very important.
@empty sentinel congress doesnt understand the word "Backdoor"
lol. No they do not. It's hilarious how badly they don't understand that word.
@empty sentinel https://www.youtube.com/watch?v=wwRYyWn7BEo
Subscribe to our weekly newsletter to get such interviews in your inbox: https://www.tfir.io/tfir-daily-newsletter/
This is worth a watch ^
Linus Torvalds' dad is testifying there
and he educated the room on software models.
@empty sentinel I like how shady the NSA is. Because they all try to find out if IF the NSA did anything at all 🤣
This user summed it up pretty well
What would happen if the linus allowed backdoors in Linux:
1. Someone would find it
2. They would fix it and push it back to the official repository
3. If Linus refuses, then someone would just fork linux and fix the bug and then we would have the Linux kernel and some other forked kernel like LibreLinux of SafeLinux, or some other stupid shit.
Basically it's in nobody's interest except the NSA's.
That's the way it should be. To be honest, I consider the NSA's back door access to be "unauthorized" and find no authorization for it in the constitution of the United States. But I think I'm getting in to politics here, so that's all I'll say on the matter.
@empty sentinel I think it has more to do with the people asking the questions
when this lady asks what the difference is between "direct unfetted access" and "indirected fetted access"
just shows how clueless she really is.
digital incompetence runs strong with politicians
I love how Microsoft representative lied under oath to congress.
(It's not a backdoor if it's put there on purpose) - Microsoft
Fascinating video. Thanks for sharing. 🙂
@empty sentinel its pretty old
but I always love watching these hearings on tech
because it shows the disconnect between the tech world and everyday life
to them, phones are just magic. you put facebook and whatsapp on it and it just works
they haven't the slightest understanding of how these systems are designed
I wish there would only be IT professionals instead of these lawyers
Just install an additional door in the congressional hall, put up a movie theater line-divider thing, and tell people to not use it. Then for demonstration purposes, have any random person, at any time, walk right through it.
Hey guys, nowadays I'm a bit bored. I don't have any projects going.
I was wondering if you guys had any idea on something interesting to do. Be it purely software related or with some hardware too
I have done a fully custom layout keyboard (designed the PCB myself etc), I have worked on machine learning (computer vision) and the math behind it, I have done a bit of docker/kubernetes etc, a probe that can measure ghosting on a screen etc....
If I put the time and effort into it I believe I can do some fun things, but I don't have ideas :/
I don't know where to ask that beside there
I didn't see any DIY channel
try making a game engine with a low-level library like opengl
Multicast video on your network so that if a video is streamed on your network, it is streamed only to clients that want to watch it.
Bonus if you can stream over the air TV like this 24/7.
Create a text message alert for when the dryer and/or washer is done. Bonus if you can make it very low power and you can calculate the yearly cost of running it.
Very difficult: Create a proximity location service so that you can locate any Bluetooth device in your home (I.e. CorewyynCell is in Living room). Engineer-tier bonus if you can do this purely through voice. (Computer! Locate wife phone! “It is in the dining room”)
- Create a tracking system that monitors movement and actions of an individual
Bonus: Change their credit score based on this
Llloll
any regex admirers here? Pretty excited about one of my most recent ones;
^(\w{3} \d{1,} \d{1,}:\d{1,}:\d{1,}) (.*?) sshd.*?: (Invalid|Connection closed|Accepted|Disconnected).*?(?:user|for) (.*?) (?:from| )? ?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) port (.*?)[ |\n](?:\[(.*?)\])?
It's for monitoring /var/log/auth.log and extracting the useful data for ssh login events
This seems interesting. Especially the voice thing, having my own jarvis seems fun haha
@somber dome build something with artnet.
Network protocol ment for stage lighting and smart home fixtures
basically ^
This is a personal favorite of mine, I've been wanting to do something with this for some time now.. just lack of time in general
I've done stuff with DMX512 before, built my own controllers
but artnet is DMX512 over ethernet.
Artnet is simple enough, that you could implement a client for it yourself. Its just UDP packets
Like on a microcontroller with a $3 ethernet interface
I'm not an artistic person, I'm more of practical one
I build my keyboard because I wanted a mechanical keyboard with the numpad on the left and I didn't find one
Same for the ghosting-probe etc
Still I'll take a look into it since my gf doesn't think like me haha
Have anyone seen this crazy program before? https://github.com/mame/quine-relay/blob/master/QR.rb
what is back end exacly?
Quine's output their own source code right?
Is code like that hand written or do people write software to write quines
Ive been toying around in java trying to implement this data structure that in theory would be faster with insertions than arraylist, but for some reason its not. I have a feeling its due to weird deeper-level optimization stuff with memory access and whatnot. Assuming you say LinkedList's insert is worst-case linear, and usually constant. Then mine should be log(n), mine works by using arrays linked together by an arraylist, and the arrays added double the total capacity
Does anyone know in simple explanation why this isn't faster?
how would I connect my nodeJS backend to my solidity smart contract?
is python on higher level too or its close to c/c++
@sharp bear backend or backdoor?
Backend is just jargon for software that runs on servers (in the back office), as opposed to the frontoffice (perhaps a portal or website)
i dont understand. can python access memory
not natively no. But you can still create variables and read/write bytes
python being interpreted, means it does not have native access
one more question
@peak acorn arraylist resizes are done with System.arraycopy()
can u make apps for android,ios writen in python
only java
not quite
Android studio uses java,
But iOS development expects you to use swift or Objective-C
Android can also be written in C/C++
But if you want to do easy app development on both android and iOS, might want to look into Ionic or Cordova
I think those use javascript, html and css
to build "web" apps for mobile phones
its similar to how discord does it
omg
Build cross-platform desktop apps with JavaScript, HTML, and CSS.
This is what discord uses ^
facebook is trash
@sharp bear electron is quite heavy though
i make website exp twitter and make twitter app
thats why if you press CTRL SHIFT + I in discord, you get that browser inspector as on chrome
oh yes
styling and layouts in electron is just html & CSS
u r amazing thank u
read documentation lol
idunno how to do this crap. I don't do app development xD
I do backend dev primarily
electron seems to be just npm
so you need to install nodejs
right
it's essentially a HTML5 web app running on chromium, chromium is causing a lot of problems with quite a lot of hardware especially older webcams etc
yep
@sweet sluice and its also projected the future of power demand
if everyone starts using electron
by the year 2050, we'll need double the amount of power plants
because its the most inefficient trash that has ever to come out of the webdev ecosystem
if you scroll through discord chat history, your CPU will be pinned.
I'd say by 2025 😄
Hey people, anyone have some knowledge for SAP training?
I'm considering take a training to get some job, but I wonder which training should I got, anyone can advice me?
ah yeah I am not really programmer so I don't think I am looking for programming one 🙂
Sorry i went to sleep immediately after asking my question. By memory access i meant like hardware optimization like memory caching and stuff. Since in an arraylist the data is supposed to be in a single chunk you can fit into cache but when you have a linkedList, or possibly in my case when you have an arraylist of obj[] references you dont get the benefits of caching and prefetching and whatever your entire dataset
That's my theory
Are system array copies super fast or something, like constant time operations?
@peak acorn yeah its a low level operation, takes two array pointers and copies it from A to B
its fastest way in java to copy array data
Is it like super super fast? Because im my mind i still think my code should be fast but its definitely slower
@peak acorn its faster than a[0] = b[0] in a loop
but you dont really need arraycopy that much
its used by ArrayList internally
and perhaps in some other highly optimized data structure
Ummm so I wanted to run a cmd prompt command from a python script and was planning to run a .bat file but is there a better way to do it in the python script itself?
`import discord
#Read Token
with open("token.txt","r") as text:
token = (text.read(-1))
#Client
client = discord.Client()
#Events
@client.event
async def on_ready():
general = client.get_channel(825161121149222956)
await general.send("Wassup Idiots")
@client.event
async def on_message(message):
content = message.content
if content[0] == '!':
if content == "!mango":
general = client.get_channel(825161121149222956)
await general.send("Mango")
else:
general = client.get_channel(825161121149222956)
await general.send("Invalid Command")
`
I'm probably doing the general = client.get_channel(825161121149222956) thing wrong is there a better way to handling this without having to copy it whenever i wanna send a command
its a python discord api code btw
use classes
object oriented programming
that does not help the noob python programmer
it's hard to explain and I don't really have time rn to explain
maybe someone else can
Agreed
haha this is incredible. https://twitter.com/ryancdotorg/status/1375484757916672000
Okay, I managed to encode my avatar with terminal escape sequences and unicode block characters and put it in the author email field.
git clone https://t.co/TWHTRMkely /tmp/a256c3c
cd /tmp/a256c3c
git --no-pager log -s --format="%ae"
146
553
Oh ok
Hi I need an advice. I'm developing a c++ password manager and I want to generate TOTP for 2FA; I searched online and I found lots of libraries. Do you suggest one in particular?
Here's the last updates on the game I'm developing 😃 https://youtu.be/452Ut5P47TU
By making the main musical theme for my game (even if it's still a draft) I feel like Octahedrone's idea is shaping up and it feels more an more like an actual game. I'm not that far from being able to add the characters and story element, so I'm pretty excited about the coming steps.
Previous episodes: https://www.youtube.com/playlist?list=P...
does anyone have an m1 mac and uses android studio on it? if so, what's your experience with it?
i dont, but i would guess that its probably a pain in the neck to use (at the moment, it will likely get better in the future, but it will probably take a while)
anyone here know any good forums/discord servers/resources for developing with Flutter/Dart?
i only use android studio for the occasion project, but it sucks to hear that
dont take my word for it, i havent tried android studio on M1 (i dont have an M1)
but all im saying is, dont be suprised if you find out that its terrible
i think there's a precompiled binary but that doesn't mean much
from what i can gather, it mostly works, with some occasional crashes
however, the Android VM does not function at all, due to the lack of virtualisation supoort from apple
(ARM is also not very good for Virtualization either)
@shell cliff
android said they're working on virtualization
@clear thistle forget it.
not gonna work
android virtualization on PC relies on Intel HAXM
@shell cliff most likely not gonna work
yea i had a feeling they weren't going to be using HAXM
recursion
lmao yeah true
I just started playing around with recursion can get bad if u don’t know how to stop it
Anything is bad if you don't know how to stop it
Running one or making one? What kind of bot?
Am I weird for finding pythons parsing system fun
Have you tried building your own programming language or custom parsing system? I remember learning how programming parsing works. It it cool.
Please no, oh god no.
I made a simple CLI calculator that can parse basic math formulas. I am going to redo the parsing system some. It wasn't that hard.
That's the kind of project we give students in the first semester of University, so they learn Reverse Polish Notation.
It's a good way to teach queues and stacks.
run it from terminal so u can just ctrl+c to stop
wdym by parsing system?
https://www.bleepingcomputer.com/news/security/phps-git-server-hacked-to-add-backdoors-to-php-source-code/
https://news-web.php.net/php.internals/113838
In the latest software supply chain attack, the official PHP Git repository was hacked and tampered with. Yesterday, two malicious commits were pushed to the php-src Git repository maintained by the PHP team on their git.php.net server. The threat actors had signed off on these commits as if they were made by known PHP developers.
I wonder who found the security issue
probably the first person who went to push to the repository
and realized the hashes didnt match up
git is pretty secure
you can't just go back in history and change some commit in the past, without nobody noticing it
because the entire commit tree is using a hashchain/blockchain
In cryptography and computer science, a hash tree or Merkle tree is a tree in which every leaf node is labelled with the cryptographic hash of a data block, and every non-leaf node is labelled with the cryptographic hash of the labels of its child nodes. Hash trees allow efficient and secure verification of the contents of large data structures....
that top hash would be your initial commit
thats the only commit in your entire structure with no parent commit
Well yeah I mean changes are visible by everyone im p sure
but was in a php employee or some open source contributor i wonder
A lot of people would just go '"huh? why isn't it working? I guess I'll just --force?" :/
I mean, experienced developers shouldn't ... but a lot would.
is there a good speech to text or text to speech machine learning paper to implement?
@arctic tusk text to speech is science of its own
there's a whole myriad of papers and algorithms
natural language processing and such
usually some kind of neutral network or Markov chain logic
Looking for using neural networks. RNN, LST, Conv, etc...
@warm sleet I was playing with Gans and implemented dcgan, wgan, cyclegan. I was looking for something that uses gan for text to speech.
But these are all visions stuff.
Generative adversarial networks have seen rapid development in recent years
and have led to remarkable improvements in generative modelling of images.
However, their application in the audio...
This is one of the interesting text to speech gan network. GAN-TTS
yo i need help with something
i have a homework where i have to make a site
everything works perfectly except my photo that i wanted to insert
File://
Instead of c:/
Well tbh I think u still need the c:/
But it should be like file:// if u have files locally, itll probably give u warning in browser u need to accept before image displays
@unique folio
Either put file:// before c:/ or better yet put image in same folder as html and then do file://imagefilename.jpg
I think u don't even need the file:// if it's in the same folder
U just need to put filename
if its in same directory, it doesnt need full path, just file name
no
dreamweaver is bad for learning
and it kinda sucks
there are better tools for actual developers
better than writing it all out manually...
no one writes html manually
except for school
exactly
this guys doin it for school
(im doin php for school and we use dreamweaver to sort out the html for us)
bad
also, adobe, no linux support 😢
ye ik
teacher is almost 70
so
bad language design, and insecure code
haha ye ik
ive gotten in trouble multiple times for having linux on my school laptop lol
no i meant why is dreamweaver bad for school?
makes you not know the language
why I argue that IDE's are bad for learning
well we're using it to get the html out of the way
we are learning php, not html
we write the php 'manualy'
@unique folio if doing it just by filename doesn't work, create a private discord server, upload the image there and just copy the link in
or ya know, google drive, onedrive, etc.
lol
taking advantage of discord cdn
Discord CDN best free host
shit aint working
surely someone makes a personal cloud storage client that stores all ur files in discord lol
lemme see if that exists
it does
lol
yup
