Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2017-11-23 00:00:00Z and 2017-11-24 00:00:00Z
Avatar
Old CMake doesn't understand CMAKE_CXX_STANDARD and similar, add the parameter directly.
Avatar
[ddnet/ddnet] New branch created: staging.tmp
02:48
f0c647d Change os_compare_version to os_is_winxp_or_... - heinrich5991 [a60320b](https://github.com/ddnet/ddnet/commit/a60320b87a6d4319473df9e78b2126ec9d27be3a) Activate C++11 in old CMake as well - heinrich5991 [bf4e5c2`](https://github.com/ddnet/ddnet/commit/bf4e5c2389c04de0d7ab9963423338cabd02d291) [ci skip] -bors-staging-tmp-951 - bors[bot]
02:48
f0c647d Change os_compare_version to os_is_winxp_or_... - heinrich5991 [a60320b](https://github.com/ddnet/ddnet/commit/a60320b87a6d4319473df9e78b2126ec9d27be3a) Activate C++11 in old CMake as well - heinrich5991 [add0b88`](https://github.com/ddnet/ddnet/commit/add0b8897635d3f311a004e13447e8f684e6c429) Merge #951 - bors[bot]
Avatar
f0c647d Change os_compare_version to os_is_winxp_or_... - heinrich5991 [a60320b](https://github.com/ddnet/ddnet/commit/a60320b87a6d4319473df9e78b2126ec9d27be3a) Activate C++11 in old CMake as well - heinrich5991 [add0b88`](https://github.com/ddnet/ddnet/commit/add0b8897635d3f311a004e13447e8f684e6c429) Merge #951 - bors[bot]
Avatar
ChillerDragon 2017-11-23 07:24:35Z
@ReiTW I think if you want to rename ddnet you have to stop the server from telling the clients "im a ddnet Server" but this also fucks the whisper feature and freezing/exploding bullets in maps. And probably some more ddnet stuff. I made it on my Server 😃 i renamed it to DDrace lul. So that ddnet clients still can use zoom. If you Need the code i can check. (edited)
Avatar
The engine now takes std::shared_ptr<IJob>, this will ensure the appropriate lifetime of the given parameters, it also allows for proper destruction. Remove the now obsolete IFetcher interface and CFetcher class. Also adds some locks to CUpdater, previously it didn't have any locks at all.
Avatar
@Savander here?
14:50
What's up ?
Avatar
do you make money from web development?
Avatar
yes, why?
Avatar
Q: how much do you take for a simple static website?
Avatar
huh, im not good person to ask
Avatar
trying to get a grasp for the economics of this all
Avatar
I'm from Poland, we have
14:52
ehm, they pay us less
14:52
especialy polish clients
14:52
in poland, for static page. i think about 600-1000pln
14:52
its like 300-400€
14:52
I mean, static page with few subpages
14:52
without CMS
Avatar
well isn't the world about outsourcing nowadays? 😛 people get an indian team to do your work for 20 euros and some bread
Avatar
Something like Landing-page (product pag,e where you can send request)
14:53
100-150€
14:53
Ofc, im talking about programming + graphic design
Avatar
prices in poland seems fair
14:53
I've heard much worse tbh
Avatar
yes, but you have to know
14:54
that, if you are doing it as a alone person then its fine
14:54
but it works a bit different, you know
14:54
it's split by 2 people at least
14:55
graphics designer and developer
Avatar
ouf, true
Avatar
@Savander you're also a graphics designer? cool 😮
Avatar
and, if it takes a 2 days for example, or 3. It's not that much in overall
Avatar
I was never able to do anything remotely good-looking
Avatar
Noo, im not
14:56
I'm working with graphic designer
Avatar
@heinrich5991 give bootstrap a try
14:56
It makes wonders out of shitcoders 😛
Avatar
I can do something.. but 🎬
14:57
Yea, and every single page looks the same
14:57
😄
Avatar
(btw, @Learath2, if you've got too much time at your hands: https://github.com/ddnet/ddnet/pull/953)
Avatar
I'm thinking of getting in to a bit of a binge webdev
Avatar
@heinrich5991 I'll review it 😃
Avatar
If you will have orders, then it's fine side-job
Avatar
did you test it with -fsanitize=address or valgrind?
Avatar
I'm actually looking for a job, but I am freelancer at the moment. I did some sites, but you know.
Avatar
hmm, I imagine it's a competitive market given a lot of people want to do what I want to try :/
Avatar
Employers wants students or people with at-least 2years of commercial experience
14:59
its hard, im rgith after school
14:59
:/
15:00
I was thinking about college, but I'll go in next year, first I need moooney lul
Avatar
Is it expensive in polan?
Avatar
College?
15:02
Not like school, but flat
Avatar
@Learath2 no. in fact I haven't tested it at all yet
15:03
let me try
Avatar
what have you done 😦 why do you change so many things? 😄
Avatar
I changed jobs to use shared_ptrs
15:04
this way, you don't have to fiddle around with your own use counts anymore
Avatar
I can see that part
Avatar
@heinrich5991 is looking for negative count of lines
15:05
i bet
Avatar
so now jobs implement a Run() method?
Avatar
yes
15:05
and you can pass them directly
15:05
without all that function pointer dance, which means you get some type-safety as well
Avatar
might want a virtual int Run(); to keep the old interface no?
15:06
to keep m_Result I mean
Avatar
yea, I removed that, I think no one or almost no one used it
Avatar
Does virtual keyword means, that it has to be implemented?
15:07
In other class, like interface?
Avatar
virtual means it can be implemented
Avatar
so no generic way to imply a task failure?
Avatar
= 0 means it has to be implemented
Avatar
o.O, So what if you do not implement that function
Avatar
does not compile
Avatar
no one checked the return value anyway. you can store in your IJob subclass if you want
Avatar
but without = 0
Avatar
then you have to implement it in the interface
15:08
like provide a default
Avatar
Oh, get it
15:08
it's like abstract methods/class from PHP (edited)
Avatar
@heinrich5991 so no longer callbacks but virtual functions, does that have any implications?
Avatar
same performance, more type-safety
Avatar
I meant more semantically
Avatar
no semantic implications I think
15:11
if I understand "semantic implications"
Avatar
might want m_Progress/m_Current/m_Size to be atomic, while it's well defined when accessing from OnProgress I'm not sure if it's entirely safe if you access it while the callback is accessing it (edited)
15:20
@heinrich5991 also do you need locking to copy to/read from m_aStatus and/or m_Percent don't really need it to be well defined either
15:22
@heinrich5991 don't see anything else, will test it myself aswell before merging tho
Avatar
@Learath2 client currently crashes on start :/
15:23
don't understand why
Avatar
great 😄
Avatar
it's not something fundamental though
Avatar
but it compiles!
Avatar
show bt? maybe I've seen it before
Avatar
nah, I can tell you the exact line
Avatar
context matters! 😛
Avatar
The engine now takes std::shared_ptr, this will ensure the appropriate lifetime of the given parameters, it also allows for proper destruction. Remove the now obsolete IFetcher interface and ...
15:25
I currently don't initialize the smart pointer
15:26
but even if I do, it still crashes with a null pointer
15:26
and I don't get why
15:26
diff --git a/src/engine/shared/masterserver.cpp b/src/engine/shared/masterserver.cpp index 85d1f3f15..bf8596a6e 100644 --- a/src/engine/shared/masterserver.cpp +++ b/src/engine/shared/masterserver.cpp @@ -53,6 +53,7 @@ public: // add lookup jobs for(int i = 0; i < MAX_MASTERSERVERS; i++) { + dbg_msg("dbg2", "%p", m_aMasterServers[i].m_pLookup); *m_aMasterServers[i].m_pLookup = CHostLookup(m_aMasterServers[i].m_aHostname, Nettype); m_pEngine->AddJob(m_aMasterServers[i].m_pLookup); m_aMasterServers[i].m_Valid = false; @@ -136,7 +137,11 @@ public: { mem_zero(m_aMasterServers, sizeof(m_aMasterServers)); for(int i = 0; i < MAX_MASTERSERVERS; i++) + { + m_aMasterServers[i].m_pLookup = std::make_shared<CHostLookup>(); + dbg_msg("dbg", "%p", m_aMasterServers[i].m_pLookup); str_format(m_aMasterServers[i].m_aHostname, sizeof(m_aMasterServers[i].m_aHostname), "master%d.teeworlds.com", i+1); + } } virtual int Load()
Avatar
that' not a nullptr dereference tho, why would it crash there?
Avatar
because I didn't initialize the shared_ptr
15:26
but even if I do, it is still a null pointer
Avatar
oh = doesn't really mean = in C++
Avatar
*m_aMasterServers[i].m_pLookup
15:27
that can be a null pointer dereference in C as well oO
Avatar
oh nvm, I'm blind apparently
15:29
shouldn't you remove the * and assign make_shared instead?
15:30
I'm not even sure if it's valid like this tbh, you'd need some allocation to take place no?
Avatar
@Learath2 I don't want an allocation there
16:09
to keep the allocation semantics the same as before
16:09
(i.e. no allocations at runtime due to that method)
Avatar
if you assign a make_shared the = operator is overloaded, I think it'd just switch the tracked object
Avatar
@Savander what is the new hip setupi to get started with web development?
17:18
in which area (edited)
Avatar
changes every time I try getting started 😛
17:19
less/sass, bower, npm, composer, what do people use nowadays?
Avatar
composer, yarn, sass
17:19
react js or vue2
17:19
they are trending
17:20
especially Vue2
17:20
because of laravel
17:20
(vue2 is included into that starterpoint)
17:20
WebPack
17:20
to compile frontend stuff
Avatar
thanks oh phpgod
Avatar
you can use laravel-mix, which simplify that.
17:21
the question is, if you want to go front or backend
17:21
or fullstack
Avatar
ofc fullstack (edited)
17:21
need everything 😄
Avatar
great, then choose which framework do you want to use
17:21
on backend
17:22
Symfony2, Zend, Laravel ( most popular at the moment )
17:22
and some more, but you have to choose by yourself
17:22
Laravel has best community ever made (ha )
17:22
and Documentation
Avatar
arent you supposed to make interactive sites that interact with the backend using a REST API now or is that trend dead already?
Avatar
It depends
17:23
What do you want to have done
17:24
:PP
17:24
But yea, you can use laravel as a REST API point
17:24
and make full front-end based on React/Vue/Angular
17:24
or whatever you want to use
Avatar
I think I'd rather generate the pages like we did in ye olde times
Avatar
I can't recommend you framework
17:24
im using Laravel.
Avatar
ofc, it's all preference
Avatar
But laravel has a big levle of abstraction
17:25
i mean
17:25
It's pretty humanish
17:25
in writing
17:25
If you want to start with laravel, then you can check https://laracasts.com/series
17:26
veeery good starting point.
17:26
OFC! You could go into Ruby on rails, or other languages
17:26
like Go
17:26
I don't know how you like PHP 😃
Avatar
I'm on decent terms with PHP
Avatar
Nowadays, PHP is pretty fast
17:27
don't go below PHP 7.1
Avatar
so many things
17:27
it used to be so easy to get started with these things
Avatar
Just start from backend, and basic front-end
17:27
Do not do everything at once :p
Avatar
get a webserver, get a text editor and call it a day
Avatar
Actualyl, it's pretty easy
17:28
you need composer, webserver
17:28
and that's it 😃
Avatar
now you need a compiler for css files, a program just to assemble it all together
17:28
does composer do frontend too?
Avatar
I mean, Laravel do it all out of the box
17:28
no, composer manages php packages
17:28
you would like to use NPM (or Yarn)
Avatar
why php needs a package manager is completely beyond me btw
Avatar
I prefer yarn, it uses NPM repositories, but is faster
17:29
why php needs package manager? 😮
Avatar
front-end even boggles my mind further
Avatar
I think, now everything is based on packages
Avatar
are we incapable of getting our own packages from the sites?
Avatar
What do you mean? 😃 Btw. i'm more like backend
17:30
than front
Avatar
why do I need yam to go get me the bootstrap package, while i can just go to bootstrap.com meself
Avatar
in terms of web development
17:30
you don't need! 😄 It's perfectly fine to download it from website
Avatar
why do i need grunt to put it all together while there is nothing to put together, compile thy sass files, move them in place
Avatar
yarn will manage packages, if you want (for example), to install ReactJS
17:31
because, it has additional packages, like routing
17:31
which depends on other packages
17:31
generally, yarn (and npm) download a lot of stuff
17:31
that's why im not front end
17:31
it's.. pretty heavy
Avatar
things like reactjs also boggle my mind, it's like html is not even used anymore 😛
17:33
People now expect, that everything on website will execute immediately. Without refreshing. Like native app
Avatar
I don't even follow how the modern stuff mixes with php
17:34
I mean the php part has to be a REST API as anything pre-generated won't be interactive at all thus making all the JS stuff useless
Avatar
seperate php and other stuff
17:34
php is standalone thing
17:34
you can use whatever you want on backend
17:34
front end just request for informations
Avatar
yeah used to be that php generated the actual html
Avatar
it's perfectly fine, to do it
17:35
you don't even need to use Javascript to make good website. Not every single page need supper dupper interaction
17:36
for example blogs, wordpress
Avatar
think I'll go with some arcane mix of php and bootstrap to kick it off
Avatar
Most of the Javascript is placed in admin panel
17:36
just to make operation on it, smoother
Avatar
or Foundation, used foundation once, quite nice
17:37
might even have liked it more then bootstrap that one time I actually used it for sth serious
Avatar
tbh, I don't remember when I used css framework last time
Avatar
well you did say you are more a backend person
Avatar
for me, they are too heavy
17:37
Yea, but I can css and html :D:D
Avatar
I love reinventing the wheel but with html it escapes me
Avatar
Do you want to follow modern stuff? or want to be as much compatible with old browsers as you can?
Avatar
I don't know how I'd even start arrenging elements without a framework helping me with a grid
Avatar
generally, css framework solves a big problem
17:39
"grid"
Avatar
and responsive design without a framework, I can't even begin to imagine 😛
Avatar
but now CSS natively supports grid. 😛
Avatar
oh I know this website, It's like a horror movie
Avatar
why :!? 😄
Avatar
look at all the things you have to think about if you want your site to work everywhere
17:40
we should have enforced web standards long ago
Avatar
Oh, and the most important thing about html and css
17:40
start from mobile view.
Avatar
and by enforced I mean just flat out refusing to render the website if it's not compliant
17:41
@Savander are you more for responsive design or having a seperate mobile version?
Avatar
both are good, but it depends on type of website
17:42
if it's static page, I don't see reason to make "mobile version"
17:42
like, custom HTML and CSS
17:42
if it's some kind of web app
17:42
then I would redirect mobile users to mobile version
17:43
because, then you don't have mess in html structure
17:43
and generally it's easier to read and maintain
Avatar
yeah, I've seen some pretty horrid stuff trying to cram the website into a mobile version using css
Avatar
Yea, and very often they are using js
17:43
to move elements around
17:43
(css-grid fixes that problem)
Avatar
css-grid looks quite usable actually
17:44
pretty well supported accross the board
Avatar
yup 😉 And it's not even that hard
17:44
to use
Avatar
maybe I'll try getting into not using a front end framework
Avatar
Crazy fact: css-grid was introduced in this year
17:45
in march i guess
Avatar
does sound like a waste of time tho, hmm
Avatar
like, every major browsers did that
Avatar
don't really know why I feel that way tho, I'm all for doing everything from scratch
17:46
@Savander btw do you have some kind of livereload on your browser?
17:46
would be quite useful actually
17:47
If I do front-end, then yea
17:47
but it's like a plugin inside IDE
17:47
Good starting point for Grid
Avatar
would be nice if I could have sth that watches my sass files, compiles them on change and reloads my browser
Avatar
laravel-mix will do that 😃
17:49
but without reeloading browsers
17:49
to reload browsers, you need another plugin inside your editor probably
17:49
or browsers plugin, to looking for changes in file
Avatar
ooh, like the way she explains stuff, thx nicetalk
17:51
17:51
it will help you in learning laravel and other stuff
Avatar
aand I'm confused again, do you have your backend and frontend in one project even?
17:52
😛
Avatar
I'd develop them seperately if you asked me
Avatar
you can download laravel-mix as a standalone package (edited)
17:52
don't worry
17:52
If you would have trouble, i can help
Avatar
I think I'll ignore all this mess and write a bash script that watches my sass files :/
Avatar
if you want to configure compiler by yourself, then sure
17:54
😉
17:55
but wiht laravel-mix, you could just
17:55
yarn run watch
17:55
or npm run watch
Avatar
I think I have a better question
17:56
tell me how you start a project, I'l most definately use php, assume I won't use any framework
Avatar
Then it would be a bit hard
17:57
because you would need to have some kind of routing, requests/response class
17:57
database management
Avatar
programming wise or is it the setup that's hard?
Avatar
programming
17:58
php gives you standard function
Avatar
as said I don't mind reinventing the wheel
Avatar
you would like to start from index.php
17:58
you have to control everything from that file
Avatar
I mean more the setup involved in getting a development environment going
Avatar
it will use your other classes, files
17:59
oh, okay. I can tell you, how i start by using laravel
17:59
You need composer
Avatar
assume I'll do some front-end aswell btw
18:00
Don't worry, laravel will give you option out of the box
18:00
It has his own template engine
18:00
generally, everything what you need to be full-stack developer
Avatar
I'm sorry but is this normal in the web world?
18:01
why is everything so overreaching? Is there anything that does one thing anymore?
Avatar
ofc, you can use Lumen (Laravel framework, but only as a API)
18:01
to write code
18:01
and front end on your own
18:02
you don't even need to use Laravel front end helpers 😉
Avatar
so I get composer, I get laravel, what next?
Avatar
But yes, i think most of the major framework gives you possibility to manage front end, and backend
18:02
Aaand, you start developing 😄
18:03
Each year, the Laracasts "Laravel From Scratch" series is refreshed to reflect the latest iteration of the framework. This is the 2017 edition, which uses version 5.4 of the framework. Are you hoping to level up your toolset? You've come to the right place. This series will take you from installing Laravel, all the way up to mastering the essentials of the framework.
18:03
You should check that series
Avatar
already watching as we speak
Avatar
it will bring you into laravel very smoothly
18:03
then you will just use your own skills and documentation
18:03
I don't know how you like OOP
18:03
but Laravel is OOP framework at most
Avatar
oh great, hate oop
Avatar
I don't know if there's any other type of PHP frameworks
18:04
Can't help you in that
Avatar
I'll get used to it, been through worse
Avatar
Because, every fucking tutorial, start from
18:04
"MVC!!!"
18:04
you have to use MVC
18:05
and you have to use SOLID principles
18:05
that's fine.. but not everyone wants to ;p
Avatar
that's why I wanted to do it on my own btw
18:06
so I can code as I'm used to
Avatar
oh, and one more thing
18:07
before you start (edited)
18:07
Another type of Web developer iss
18:07
Wordpress developer
18:07
generally, that guy makes everything on wordpress. templates, settings, functionallity
18:08
and i think, wordpress guys have more orders
Avatar
definately not my flow
Avatar
It's most popular Web cms
18:08
not mine either
18:08
i don't like wordpress. It has very ugly code
Avatar
btw why'd I need routing even? the webserver is pretty good at finding files 😛
Avatar
For better SEO
18:12
And for better management of code
18:12
they will never have direct access to file
Avatar
why not though? I see no harm in them accessing it
Avatar
You could do things like
18:13
/something/:username/posts
18:13
without trouble
18:14
in parsing queries (edited)
18:14
anyway, it's standard at the moment
18:14
but if you want, you can use simply files
18:14
😉
18:15
You'll have to reinvent some things, but it will works
Avatar
very interesting stuff
Avatar
also, before doing anything in pure php
18:15
learn about auto-loading classess and files
18:16
btw. Composer can generate autoload class for you
18:16
based on composer.json configuration
Avatar
inb4 I create the worlds biggest sql injection nest
Avatar
@Savander how does Eloquent know which table to use?
18:38
It's like blackmagic
Avatar
actually not
18:38
it takes class name
18:38
and check for plural or singular
18:39
you can specify which table Eloquent has to use
18:39
in your model class
18:39
public $table = "nameOfTable"
18:39
PHP Has cool staff, called ReflectionClass
Avatar
I'm hoping this actually is calculated beforehand
Avatar
it can do magic
Avatar
checking for plural singular at runtime would be funny
Avatar
i bet it simple if, but
18:40
I always statically set table name
Avatar
e.g. category->categories not categorys
18:40
lots of exceptions
Avatar
It's pretty smart
18:41
It good in making word plular
18:41
in english
Avatar
that's what worries me
18:41
if it's that good it probably has a database of the exceptions built in somewhere
Avatar
probably
18:41
it uses Str component
18:41
and i think, it's external one
Avatar
keep forgetting I'm not supposed to worry about this stuff
Avatar
You can to :pp. You will learn how it works
18:42
and it's cool, isn't it?
Avatar
I don't really like cool, I much prefer well-defined 😛
18:43
in C if I put an = sign I'm 100% certain what it'll do
Avatar
Right
18:44
in PHP you can do some magic sometimes
18:44
because, php allows to
18:44
for example, you can generate methods in fly
Avatar
but at that point I'm also supposed to think how the language is working
Avatar
Eloquent uses it
Avatar
with something the size of laravel it's impossible for me to keep track of it's internals
18:45
so I'm at some point supposed to just hope it works
18:45
ooh, methods on the fly sound fun
18:45
larafel is well written, you shouldn't worry
18:46
i think, you will know what's going on
18:46
after reading documentation
18:46
and even know, where that magic happen
18:48
That class do magic in plurarization
18:48
package *
Avatar
55 thousand lines of code in laravel 😛
Avatar
Huh, a lot
18:49
/ 2
18:49
(comments)
Avatar
i think LoC is without comments already
Avatar
Founder like to write perfect readable code
18:49
and a lot of comments
18:50
LoC ?
Avatar
lines of code
18:50
hmm, i don't know
Exported 424 message(s)