[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/wdg/ Web Development General

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 321
Thread images: 26

File: 1496845010511.png (731KB, 824x553px) Image search: [Google]
1496845010511.png
731KB, 824x553px
lazy fucks

>old thread
>>61048526

>Discord / IRC
https://discord.gg/wdg
#/g/wdg @ irc.rizon.net
Web client: https://www.rizon.net/chat

>Getting started
Get a good understanding of HTML, CSS and JavaScript.
Everything you learn will have these as their base.
The Mozilla Developer Network offers a good intro (no matter your browser choice)
https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web

>Online courses
https://www.codecademy.com/
https://www.freecodecamp.com/
https://www.bento.io/

>Further reading/viewing
https://www.youtube.com/watch?v=sBzRwzY7G-k
https://github.com/kamranahmedse/developer-roadmap
https://github.com/getify/You-Dont-Know-JS
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md

>Code challenges
https://www.codewars.com/
https://www.hackerrank.com/
https://codefights.com/

>Useful resources
https://developer.mozilla.org/en-US/docs/Web - General documentation for HTML, CSS & JavaScript
https://libraries.io/ - Discover and keep track of open source libraries, modules and frameworks
https://stackoverflow.com/ - Developers asking questions and helping each other
http://www.programmableweb.com/ - List of public APIs
https://caniuse.com/ - Check browser support for front-end web technologies

>Useful Youtube channels
https://www.youtube.com/derekbanas
https://www.youtube.com/learncodeacademy - codecademy
https://www.youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q - funfunfunction
https://www.youtube.com/user/TechGuyWeb - Traversy Media
https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ - freeCodeCamp
https://www.youtube.com/user/shiffman - coding train

>cheap VPS hosting in most western locations
https://www.digitalocean.com/
https://www.vultr.com/
https://www.linode.com/
https://www.scaleway.com/
https://www.heroku.com/

an in-depth comparison of hosts
https://www.webstack.de/blog/e/cloud-hosting-provider-comparison-2017/
>>
>Web
>Development
>>
File: phpgame.png (40KB, 965x528px) Image search: [Google]
phpgame.png
40KB, 965x528px
Is it feasible to build an online RPG with PHP and SQL? A choose-your-own-adventure sort of thing but with stats on health and all that shit. This sounds like a fun project for me but it also sounds like it could be a pain in the ass.
>>
>projectmanager
>management
>>
>>61088711
Nothing wrong with that, but what are you gonna do for graphics? Or is it just gonna be text based?
>>
>>61088711
Ogame was built like that and had a few thousands of players back in
>1999
>>
File: 2017-06-26_09-01-41.png (16KB, 566x118px) Image search: [Google]
2017-06-26_09-01-41.png
16KB, 566x118px
finally learning html using codeacademy. is this true lads?
>Unless your text editor has been configured properly, the "TAB" key on your keyboard should not be used for indentation.
ive been using tab the whole time ive started learning
>>
>>61089608
Had no luck with this in /sqg/, does anyone here know?
>>
>>61089814
most editors convert tabs to spaces if soft tabs option exists and enabled, tabs are superior btw
>>
>>61090081
This.

Tabs masterrace
>>
>>61089658
>Ogame
Speaking of which, there's a guy who released a really slick-looking Ogame clone a few months ago, although it hasn't really taken off. I was helping him debug it a while back. Goes by "Astral Conquest".
>>
everyone shits on codeacademy so maybe its time to change the OP and add actual decent sources for newcommers?
>>
>>61086915
>Also I've been writing this stuff for only about 4 months and I only use PHP as a method of interacting with a db, so an API.
So you started programming 4 months ago with PHP? You could have used anything else bro.

>>61088711
Why would you choose to do this with PHP?
>>
Is The Odin Project a decent free online course?
>>
File: 1494447211496.jpg (9KB, 248x233px) Image search: [Google]
1494447211496.jpg
9KB, 248x233px
>he's not an asynchronous developer
>>
File: epic shit.png (28KB, 200x200px) Image search: [Google]
epic shit.png
28KB, 200x200px
>>61090803
>Hes async isn't enabled by default in the framework
>>
>>61088711
Yes. Most browser-based MMOs, including MMORPGs, are all written in PHP:
- https://www.kingdomofloathing.com/
- http://urbandead.com
- http://www.combats.com/
- http://www.travian.com/
- http://www.forumwarz.com/
- https://yoworld.com/ (RIP)
- etc.
>>
>>61090885
Because if the devs knew how to write real code they wouldn't make a shitty MMOs
>>
>>61090942
I don't like your game because it is too real-time. And I don't like the graphics.
>>
what is the best stack and why is it vanilla PHP + SQL + vanilla Javascript/Ajax?
>>
>>61090986
>vanilla PHP + SQL
At least you got 1 correct.
>>
>>61090154
I just don't get the point of spaces. Tabs are 4x more efficient.

Tab devs are fully optimized.
>>
>>61090986
Are you me?
>>
>>61090986
How is Ajax part of the stack? It's just part of JavaScript; what alternatives even are there?
>>
>>61091429

technically any technology you use is part of your stack, technologically speaking, technically
>>
>>61090154
>>61090081
Tabs are shit because they are far less portable. Spaces are infinitely portable, tabs have portability problems, end of comparison.
>>
>>61090803
what's the difference?
>>
>>61091541
I guess so, it just seems irrelevant.

You could also include TCP, IP, HTTP, and ethernet. But that's pretty much expected, because by default you're not serving a website over torrents with a wifi-connected server.

https://en.wikipedia.org/wiki/Peer-to-peer_(meme)
>>
>>61089417
I'm still figuring out all the details like that. As in what the game actually is, lol. I'm no real game developer, webdev is my biz.

>>61090389
I don't know what else to do it with.

>>61090885
Thanks for the list of examples, I'll check them all out.
>>
>>61090986
C#, v8 and jQuery

Remember, responding really fast can be a low level ddos protection.

>>61092311
Learn c#! Or Java and spark or spring framework, or node.js, or literally anything that's not abhorrent or fastcgi hacks.

>>61091429
It's not pretty.

Slow client side code, like jQuery, is fine, especially if you can avoid it at start up.
>>
BLUEHOST OR GODADDY FOR WORDPRESS?
>>
Calling experienced web developers.

Any warnings against companies looking to contract you up asap? What is your experience?
>>
>>61090986
>vanilla php
learn a framework you scrub

honestly mvc is where its at
>>
>>61092402
Fuck Godaddy, these cunts are again net neutrality!
>>
>MUH I WANT VANILLA EVERYTHING BECAUSE USING FRAMEWORKS IS CHEATING/BLOATED

Anyone who uses this argument is most likely a programming newshit.
>>
>>61092663
Anyone with a brain is against net "neutrality"
>>
Theoretically, how bad would it be if I used <center> tags in HTML? WIll it automatically blacklist my name from all future employment opportunities in web development? I just want to center one div /wdg/.
>>
>>61092478
Experienced developer here.

I've never taken contract work.

Hope that helps.
>>
>>61092774

kys
>>
>>61092797
margin: 0 auto ya dingus
>>
>>61092797
Yes. If I were to see any styling outside of the head or script tags then into the trash it goes.
>>
>>61092670
Vanilla is the best way to learn and frameworks only make sense in a work environment. Easier to learn frameworks when you know the vanilla language really well. Actually OOP in general only makes sense when working in teams. Functional and procedural in vanilla is where it's at.
>>
i can't decide between codeacademy, bento and fcc, please help
>>
>>61092806
that doesnt help shit tbqhsenpai
>>
>>61092892
I disagree. Learning programming is language agnostic. Most logic and design paradigms are shared between languages, half of them are based on C in some way or another, anyway. I know fuck all about Javascript/Typescript but Angular provides MVC structure that I'm familiar with, for example.
>>
Learning Javascript right now. I know I've seen people here say that jQuery is getting long in the tooth, but what should I be learning instead?
>>
>>61092980

theres really no way to disagree. It's a fact learning base languages first better prepares you and gives you a fuller understanding of programming itself
>>
>>61088711
Absolutely. I built a (crappy one I don't wanna show, .send(pie)) in MEAN-stack JS, so I don't see why it shouldn't be possible to do one with PHP/SQL.
>>
>>61089814
I'm not gonna say which is superior, but most editors should be able to convert em. My sublime, for example, has a prettifier extension that can auto-space/auto-tab stuff.

On another note, is coeacademy REALLY that bad, folks? I used to love telling people to use it as a useful (tho narrow-minded) resource, but... I'd rather stop if I'm leading people down the wrong path. I feel I might not be a very good judge of it tho, since I probably know everything from it already?
>>
>>61092670
>most likely a programming newshit
I wish I could agree, but sadly... a lot of whom I see this coming from are actually 'older' programmers who were never very good at what they do, and have adopted this suicidal "learning new stuff is bad!" mantra. Most newbies I've met that are against frameworks just right out and admit that they find them confusing or difficult.
>>
>>61093348
It's fine for learning the basic syntax of a language, but beyond that it doesn't really do anything.
>>
>>61092797
Why would you tho? The point of HTML isn't styling - even the <em> and <strong> elements are used for emphasis, not specific text decoration - so using a <center> tag shows more than that you're being lazy here. It shows a lack of separation of concerns.
>>
>>61088711

Im actually doing this too. Only with jQuery added in.

Just so you know, mixing PHP data structures with Javascript json objects, is a pain in the ass to handle.
>>
>>61093448

actually its the easiest thing ever and it lets you do async stuff
>>
>>61093422
Oh okay, thanks. So compared to like freecodecamp, or something like that that is ALSO free, is it still acceptable?
My major issue with codeacademy for a while was that it was, as I said before, narrow-minded. Their interpreter (compiler?) would often have one specific way for you to complete an exercise, when there were realistically multiple ways to do it. Worse yet, the 'expected' way wasn't ALWAYS the absolutely clear way to do it. So you'd get a bunch of peeps on the forums like "I tried to do exercise ABC, but it's not accepting my code! What did I do wrong?", and they ended up coding perfectly fine.
>>
>>61093460
Maybe im doing it wrong, but i find myself parssing way to much data from one method to another
>>
What are good resources to learn towards doing OOP and building modules in JS?
>>
>>61090803
In what lang ? JS does not support async by definition
>>
Just made my first pull request on an open source project on Github. Hope them fuckers accept it...
>>
>>61092928
fcc, huge community, lots of help and actuall code reviews for free>>61093888
>>
>>61093888
Just glance over JS OOP, after that move to JS Functional programming.

It is more useful in real world and less prone to bugs.
>>
>>61093805

you parse with JSON.parse(), thats it

>>61093902

ajax is js
>>
https://javascript30.com/

Anyone have done that ?
>>
>>61093902

>js not async

woot
>>
>>61093931
ajax and all the sub js stuff does not support actual async like C++ does for example. look it up what I mean, sure you can "manage" to "make it look like" and by definition it sure is, even in vanilla JS, but under the hood its not.
>>
>>61093915
thanks
>>
>>61093947
he's right, async is related to functions that use io so they don't block execution flow wating for the OS api to return, nodejs could have been implemented to be sync, it has nothing to do with the language itself
>>
>>61093941
>https://javascript30.com/

Nope but it looks interesting
>>
File: phpgame2.png (40KB, 965x520px) Image search: [Google]
phpgame2.png
40KB, 965x520px
Mates. How do I align #flagbox and its variants to center of first cbox-cell? I've been sticking align-items and justify-content everywhere, to no avail.

https://jsfiddle.net/4vg0mdam/

If you expand the cramped viewing window then the flagboxes will rearrange themselves to suit...except on the left rather than in the center.
>>
How do I change the request type to a rest all with php?

Say I want to UPDATE. How?
>>
with promises & async/await it's non blocking, which is quite good enough for normal-scale general use

>>61094345
IDs should be unique, use classes

.cbox-cell:first-of-type {
flex: 0 0 30%;
flex-wrap: wrap;
background-color: #eee;
display: flex;
justify-content: center;
}


that markup and css is a bit of a mess with the :first-of-type and :last-of-type
>>
>>61094536
Thank you! It has all worked out. I've been laying down everything today CSS-wise, should give it a nice clean.
>>
guys i want to make a website but its my first time learning web dev, i already know python, Java and C++, what stack should i learn?? i want something with python
>>
>>61094670

well if you know those languages then you really shouldnt have any troubles learning web dev

MEAN or LAMP, I guess...
>>
>>61094670
for python you have Django as the most popular framework, followed by Flask, which is a lighter version. Then you have Bottle, Pyramid and other stuff. I'd say Django. For servers, Apache and Nginx, of course, but maybe you wanna try Zope, which is a python-based server.

If you want to get a job later on, Django is your best choice within Python.
>>
>>61094767
>>61094713

what do you guys think about front end frameworks? should i learn one or stick with vanilla from scratch?
>>
File: 360_c.jpg (63KB, 482x340px) Image search: [Google]
360_c.jpg
63KB, 482x340px
>>61094670
>>61094713
>>61094767

don't learn a stack. You don't even know what the individual parts of the stack even do yet and how they compare.
Seriously, someone says it's his first time getting into webdev and you bombard him with "Nginx, Django, this stack, that stack"

The only thing you should do is focus on HTML, CSS and JS
Then after a while, when you feel like there should be some communication of your site with some kind of backend, you can think about stacks and serverside languages/frameworks/libraries
>>
>>61090986
>what is the best stack
what is "what is the best stack"? it is a disqalifying question.
>>
>>61094846

Having a local programmable http server to use while developing is essential and really can help learn about the protocol.
>>
>>61094846
what do you think about this >>61094798
>>
>>61094846
>The only thing you should do is focus on HTML, CSS and JS

yeah, dude, but you get through HTML>CSS>JS in one week, specially since this guy already knows how to code
>>
>>61094952
Once you got the very rough basics down I would say, that there is nothing stopping you from trying out a frontend framework.
The "big 3" are React, Vue and Angular.
Check out their "getting started" docs to get a feel for them and pick one.
>>
>>61094798

Learn vanilla js first, when you feel comfortable about the DOM api like how node, elements, events and the html attributes play in there you can start picking front-end frameworks.
>>
How many people still use 1024x768 in 2017? I'm wondering whether to cater to them for bespoke responsive CSS or to just ignore them in favour of mobile users
>>
File: tabtab.jpg (13KB, 546x87px) Image search: [Google]
tabtab.jpg
13KB, 546x87px
>>61095295
as many people, as there are tablet users
>>
How do you do this in go?
https://gist.github.com/anonymous/d0973381fe840896c678b95097fa94fd#file-a-js and heres a shell version https://gist.github.com/anonymous/d0973381fe840896c678b95097fa94fd#file-a-sh
And what I really mean is how you make the last line happen in go (ignore the long comments in the files I only added them for padding), because I know how to get the stdout and everything but how do I run the goroutine without blocking literally everything after it

This is how I'm trying to do this in go
https://gist.github.com/anonymous/d0973381fe840896c678b95097fa94fd#file-a-go
and obviously the last line doesn't get printed because the waitgroup is waiting for the goroutine to finish before continuing but if I don't add it then the main function kicks off the goroutine, then prints "dadasdasd" and then the main function is done and it terminates the program with the whole goroutine and that's it

So basically I want to know how to run a go routine in the background without blocking everything that comes after it and without terminating the program
>>
Please recommend a nice PHP ORM. I am sick of writing queries in my PHP code. Doctrine and Propel seem too much for my projects, on the other hand I would like to have good documentation and community support. Any ideas?
>>
>>61096200
eloquent
>>
File: spookedpeepee.jpg (55KB, 291x217px) Image search: [Google]
spookedpeepee.jpg
55KB, 291x217px
>>61087877
>Finally applied for 4 junior/front end positions tonight
>Another 3 on angellist
>Just realized how inadequate I actually am at webdev and I'm actually just a retard who's only made a few shitty projects

Fuck
>>
File: 3khrnri.jpg (79KB, 610x357px) Image search: [Google]
3khrnri.jpg
79KB, 610x357px
anyone here who tried both Vue and React and decided to go with React for everyday projects?
Can you briefly explain, what made you choose that one?

I picked up Vue initially (quite happy with it) and am now trying to add React to my skillset as well.
Not a friend of the need to call "this.setState()". (I know there is MobX, but why isn't the state observed by default. Can't see a reason where you wouldn't want that, but I might be coming in with the wrong mindset here)
Also JSX feels really hard to "keep clean and readable".
Have not given up yet though.
>>
this is my new favorite website

http://bees.ai/
>>
Is it possible to play with reactJS without resorting to all the node/npm stuff?

I just want to load a script tag and get running,
>>
What kind of things would or should a frontend developer be able to if asked on a junior job?

Common things so far I've got:
-Image carousel
-Sticky up arrow to top of page
-Mobile navigation
-Dropdown menu
-Prototype a site with foundation/bootstrap from PSD
-Fallbacks for browser compatability
-Pagination

anything I can add?
>>
>>61097154
i used both. in .vue components the markup is on top, scripts at bottom. in jsx components the scripts at top, markups at bottom. you cant unsee that. vuejs has watch:{}.., react doesnt. react has longer code lines. i dunno. i just pick any of them depending on the fanboys that surround me in my workplace. if im surrounded by vuefanboys i use vue. else the other one. imo vue is more solid. react is starting to get really overrated. but i just swap between them. sometimes i mix vue and react to shutoff the fanboys
>>
>>61097563
you need a jsx to es5 converter, hence the node modules
>>
File: css.png (110KB, 772x586px) Image search: [Google]
css.png
110KB, 772x586px
I feel like he gave me something really helpful but I don't know what to do with this information:

body {font-family: MS pgothic !important;}

what should i do this this?
>>
>>61097741
You would put that in a custom user agent stylesheet. Apparently Chrome stopped allowing you to modify them natively, so you have to use an extension to do so.

Just look up "custom stylesheet" in the chrome app store.
>>
How do I into UI?
>>
>>61097563
No, you need to learn that stuff.
>>
>>61099536
do a wireframe

or if you're new, just go into paint or gimp and draw what you want, where you want it, colours etc, then build it.
>>
Post your hourly rate on Upwork and language(s) used
>>
>>61081838
>>61082032
Object.entries({Images: 1, Offtopic: 2, Humor: 2}).map(([k,v]) => ({[k]: v}));
>>
Can you use
 else if 
with ternary operators?

test ? expression1 : expression2  


>>61099929

Interesting problem, would you say that's a cleverer way to do it anon?
>>
Are there any sites like github besides github? I feel like uploading my things in several places for good measure.
>>
>>61097085
>literally everybody who ever started in web dev
>>
>>61097085
for your next project, do one of the things they are asking for
>>
>>61100103
>cleverer
It's much more concise, it's immutable, and it's more functional (as in functional programming). The downsides are that it uses ES features not supported in all browsers, meaning you'll want to be using babel if you need legacy support (you should be using babel for all frontend projects). Additionally, some programmers won't be comfortable with fancy new syntax. Priorities will be different based on the team members on any given project, but I'd call this approach ideal.

>Can you use else if with ternary operators?
No, you would have to nest ternaries,

test1 ? expr1 : (test2 ? expr2 : expr3)


which you should always avoid. It's very confusing to scan, and gets unwieldy very quickly. The whole point of a ternary is that you use it in simple, straightforward, easy-to-understand cases.
>>
>>61100248
Thanks anon
>>
Spent my whole day at my web dev internship studying machine learning. How do I care about my internship assigned projects?
>>
File: heymu.jpg (174KB, 800x1000px) Image search: [Google]
heymu.jpg
174KB, 800x1000px
>>61100302
Teach your machine to do the internship!
>>
>>61092478
Most places have asked me to start within two weeks, especially if they're planning on firing you after six months.

>>61092670
PHP usually is bloated. Most java, C# (besides Microsoft), node.js and whatever frameworks are fine.

>>61097563
>>61097716
Or you could use vroomsjs and a download of babel.min.js? There are v8 libraries in most language, this is actually more complicated than just installing node but
>load files
>pass them through Babel.transform
>get the result
>set a variable for the props
>the the "rendertostring" function in react-dom-server
>grab the result and build a page from it
>at the bottom if this page, run a react render function with the root component id
I've already done this, my project is called fap.react

What's neat is that unlike more server side rendering libraries that are meant for server side rendering, only react.js doesn't have a hard dependency on node.js. Marko does. Vue does.

Or, you can use random template libraries, like dust or hogan or moustache or handle bars. These are purely client side libraries, so they also rub server side (because incorruptible by node.js hollow promises). I'm testing this right now and will release when I stop seeing obvious future bugs.
>>
File: images.jpg (10KB, 168x300px) Image search: [Google]
images.jpg
10KB, 168x300px
>>61100302
Teach your internship to do the machine!
>>
>>61100635

>only react.js doesn't have a hard dependency on node.js. Marko does. Vue does

Well I'm just testing vue now and working fine just downloading their single js file and things seems rather simple, what do you mean?

On react I was actually just trying to avoid running the develop web server since I like to use my own on python, no problem in doing the whole build through node.
Apparently I can do that just after building everything into webpack and moving it to my server dir.

>Or, you can use random template libraries, like dust or hogan or moustache or handle bars

I'll check those, thanks.
>>
>>61100847
The server side rendered library, the one that spits out string, has a hard dependency on node.js seems like marko's server stuff does too.

>On react I was actually just trying to avoid running the develop web server since I like to use my own on python
Which makes sense. Most people start looking for this stuff after noticing updates aren't appearing in Google searches, there's really only one solution here and it's to do the templating or rendering at the backend.

>>Or, you can use random template libraries, like dust or hogan or moustache or handle bars
>I'll check those, thanks.
Most of them accomplish the bear minimum, which is actually something like

<div>{{data}}</div>

Where data is analogous to props.

Doing this from the backend solves many problems. PHP kind of does and was actually the first solution to this problem. Don't tell the PHP kids, but they're using a templating language!
>>
>>61096200
Yeah, switch to C# and use entity frameworks and linq.
>>
>>61100952

In fact I barely touched vue and at first it just looked a template lib like these you mentioned. I need to learn more about it.

>updates aren't appearing in Google searches

That is interesting, would it be a risk of doing the same mistake by using webpack since it is all bundled together?
>>
>>61101081
No, I guess not, but then you have to install webpack?

>unwilling to install a backend
>is willing to install a library manager
You are trolling.
>>
>>61087877

is SEO a waste of money?
>>
>>61101110

Not really, I just want to be able to build everything and to use it into my own python web server, I have no problem using node/npm for this but I want to get the files and place the page content wherever I want instead of only the node environment.

Btw I just started learning these frameworks today.
>>
>>61101142
It costs no money at all to install node.js or the myriad of C# and java solutions. Or even PHP. SEO just means returning complete pages from the backend with the entirety of the data.

Companies will basically just Google your page or check what the html looks like. That's a waste of money. Just do things right and say, "I have SEO, thank you."

>>61101172
Fair enough, at least you're not using PHP.
>>
>>61100173
Bitbucket, Gitlab, set up your own, use Google.
>>
>>61101216
>SEO just means returning complete pages from the backend with the entirety of the data.

wait what?

I thought SEO was linkspamming so you go up on google search result.
>>
>>61101142
Usually. Most SEO is snake oil.
>>
>>61101242
Google wouldn't be happy about that and it wouldn't work for long, if you wanted to game the system you'd have to use keywords and mass links in your pages.

To me, SEO is just making dynamic data appear in Google searches. After that you can do anything short of spam.

>>61101330
Or social media...
>>
>>61101242
Google is sort of in the business of detecting link spam. That hasn't been effective for a long time.
>>
>>61101352
>SEO is just making dynamic data appear in Google searches.

How does this make you rank better on Google? Is it just based on having more relevant text in your page when Google crawls you?
>>
>>61101377
You can write more content without having to upload anything and you keep writing content, which has all the right keywords in it already because you're writing something sensible, and because you're returning all this content and keywords to Google, it'll find people searching for those keywords.

More keyword matches the better.

And all you have to do is write content.
>>
>>61101395

Do you have to do anything special for google to get your dynamic content?
>>
>>61101459
Yes, because Google bots aren't going to run your JavaScript, so everything needs to come as html from your backend.
>>
>>61101395
>More keyword matches the better.
That's not the entirety of SEO though.

A lot of it is PageRank. Google gauges popularity of a site based on links pointing to that site, weighted by the popularity of the site the link resides on. (I'm not sure if that's still the exact thing they use, but the principle is the same.)
https://en.wikipedia.org/wiki/PageRank

Then there are the boosts you get for having a high performance site that conforms to all the stuff Google says it should conform to. That's basically free points if you know what you're doing.

Also I think they also use how many clickthroughs you get in the search results, so it might be hard to break into the first page for existing keywords.
>>
>>61101474

so basically just dont fall for the load content with JS meme
>>
>>61101526
Well.

You still have to load content and most libraries that do that well are JavaScript libraries, like templating libraries and reactjs. So you're still loading content with JavaScript!

It's WHEN you load it, load it before the client comes and it's sweet. Load it long before the client comes and your site has a much lower startup time, which is great for impressing local clients.
>>
>>61101543
>It's WHEN you load it, load it before the client comes and it's sweet.

so run the JS on your server before sending the HTML?

im getting more confused now
>>
File: aspnet core.jpg (33KB, 800x370px) Image search: [Google]
aspnet core.jpg
33KB, 800x370px
What framework do you guys use for large scale websites?
My company has been trying out asp.net core for some simple services, but we have a major part of our site in 4.6 still
>>
What icon set do you gays use
>>
I just discovered the joys of linting. I feel like I've been born again!

>Linting is the process of checking the source code for Programmatic as well as Stylistic errors. This is most helpful in identifying some common and uncommon mistakes that are made during coding.

>A Lint or a Linter is a program that supports linting (verifying code quality). They are available for most languages like JavaScript, CSS, HTML, Python, etc..

I guess most IDE's do have some sort of lint-like functionality, but being able to do your linting from the command line is comfy as hell. No need to scroll through your whole code looking for squiggly lines and shit, just look at the output and then fix it.

To all you noobs like me, give it a shot! Look for popular linters for your langs.
>>
>>61101575
You're getting confused because it is confusing

>You have a website, dynamic things come from ajax, it's fine
>suddenly you want to sell things, or write a CMS (because that is easy)
>now dynamic data really actually has to must seem like non dynamic data
>this means the backend itself has to get involved in sending most html pages
So this means the backend needs to start returning html.

This is what Microsoft realised when they came up with ASP.net MVC and razor and thus invented yet another templating engine with add ons that you don't want.

Notice I called PHP a templating engine? Because it is. So is Razor. Ultimately every time someone has run into this problem they've come back with a templating engine that runs slower than the already existing JavaScript templating engines and they were good, they were brilliant and simple and optimised. Absolutely no one got the idea to run these things at the backend?

Then v8 came and then node.js but also vroomjs (same thing for c#) and now people are still using PHP, they're still using Razor, they're still using failed, slow, templating engines.

So yes, enjoy the confusing because the best solution I've found at the moment is to go
C# (or Java or JavaScript) to JavaScript, the send, then run more JavaScript at the client side.

If you want node.js instead if C# or java, you end up with node JavaScript to babel or templating JavaScript back to node JavaScript to client side JavaScript. In the end I think web devs are more than happy using JavaScript for everything and here's the cracker, doing it will still respond faster than an out of the box ASP.NET system.

>>61101670
That's all I need, more machines to tell me I'm programming wrong.
>>
Any good json api provider that doesn't have a lengthy """"terms-and-conditions""" to be obeyed?

oy vey!
>>
>>61101142
SEO is real thing that is used to sell snake oil.
>>
>>61100302
Teach shipping your intern to do the machine!
>>
>>61101242
He talks bullshit. SEO is optimising your site for search engine bots and this involves a lot more. While static pages can help SEO Google and other important bots can read and navigate dynamic pages.
>>
>>61102051
>SEO is optimising your site for search engine bots and this involves a lot more.

What does it involve?

give me the downlow plz
>>
>>61101954
>json api provider
u wot m8
>>
>>61102051
I go occams razor and assume all bots are silly html crawlers that can't into any script or logic.
>>
>>61102210
This is the correct answer.
>>
Normalize.css or Reset.css?
>>
>>61102292
Neither?
>>
Could anybody tell me how to use Vue.js with Webpack, SASS and TypeScript? I don't know why it's so hard to find helpful resources.
>>
>>61102068
check googles PageSpeed Insights and Lighthouse to get a quick overview over things to optimize
(don't take all the little details in lighthouse all too serious though and optimize images yourself instead of taking the ones suggested by insights)

>>61103108
try the webpack-simple template for the vue cli tool and continue from there.
"vue init webpack-simple my-project"

Keep the webpack docs at hand and add the loaders you need.
>>
>>61087877
Can someone demonstrate how would encapsulation look in JavaScript (without using ES5 classes.)
>>
>>61103194
Learn to fucking Google, shithead.
>>
>>61103194
var Object = (function(){

var privateVar = "private"

return {
publicVar = "public"
}
})()
>>
>>61103438
>>61103194
well you wouldnt wanna name it Object but yeah
>>
What could i use for sending mails?
Example: I want to reset password for website that is on localhost. When i reset it i want token with url to be sent on my mail. How can i send that mail?
Is there like some gmail api or smthing like that
>>
>>61103438
Thanks, going to learn about the closure thing now
>>
Posting data with ajax: should I create DOM elements dynamically on success, or should I refresh the page to reflect the changes?
>>
>>61103561
whatever works for you anon, until someone comes across your site, tells you its shit and you are too embarrassed of it, so you redo the whole thing, applying the new things you learned in the past, since you are now a much more proficient developer overall, so you no longer have to post questions to /wdg/, that people could give you retarded answers to and everything is better overall.
>>
>>61103484
>>61103218
>>
>>61103638
so what do you prefer?
>>
>>61103702
eh, if you can guarantee, that the client can infer all the changes to the site from the data in the POST, then there isn't really a reason to reload the whole page, except that it's easier to code I guess.

is it to update a profile or something and then show the changes?
>>
>>61103838
it is a comment section

maybe it could result in a (non-critical) race condition, still I don't expect that many comments (~100ish users). Guess I will just embrace kiss and do a location.reload() or use the form submit. thanks
>>
>>61101781
That's a load of bullshit. In the beginning of the web all sites were static. Since this obviously didn't satisfy users web needed to be made dynamic. There were two approaches for that. First approach was to implement some sort of programming language in web server whose task is to generate html to be sent to client. Btw, template engines were born around here to make html generating easier. Also PHP was created to add server side scripting to html. Second approach was client side html manipulation and for this Javascript was invented. At some point Google created couple of extra dynamic web apps (Gmail and Maps) that popularized AJAX and basically turned it into meme. It also kickstarted Javascript based web apps that naturally evolved into SPAs. But SPAs have many problems and to mitigate them by decreasing amount of client side Javascript people again started using server side rendering.
>>
>>61104241
this is correct
>>
What should i use for sending mail with php?
All i need is to send short mails
I tried phpmailer, when i test it i get "Message has been sent" but, shit didnt get sent
>>
Why is ( x === 1 || 2 ) always true?
>>
>>61105364
What server you using? If you got no error then it probably got blocked server side.
>>
>>61105364
did you properly set up the email server? That stuff can get pretty complicated, unless you run an out-of-the-box setup.
>>
>>61105819
because it returns "2" when x is equal to 1, otherwise it returns true. both "true" and "2" are truthy
>>
>>61105956
when x is not equal to 1*
>>
>>61105819
>( x === 1 || 2 )

You think it does
x === 1
OR
x === 2

when in actually does
x === 1
OR
2

note, that it simply returns 2

so when x is not 1 (false condition), then it instead checks the second condition, which is just the number "2".
Any non 0 number is considered true in condition checks.
>>
>>61105956
>>61105974
>>61105985
All right, I got it, thanks.
>>
const todos = (state = [], action) => {
switch (action.type) {
case 'ADD_TODO':
return [
...state,
{
id: action.id,
text: action.text,
completed: false
}
]
case 'TOGGLE_TODO':
return state.map(todo =>
(todo.id === action.id)
? {...todo, completed: !todo.completed}
: todo
)
default:
return state
}
}

export default todos


Can someone explain the meaning of
return [
...state,
{
id: action.id,
text: action.text,
completed: false
}
]
Especially the " ..."
>>
>>61106033
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Spread_operator
>>
>>61106170
cool story bro
>>
>>61106170
I want to hack moot
>>
>>61106170
>a.t.m machine

see, this is how i know you're a fraud
>>
>>61106093
this.lastNight(...yourMom)
>>
read this

>How to get engineers to work overtime for free
http://lapcatsoftware.com/articles/overtime.html
>>
>>61106759
Brings back memories
>>
>>61106759
Looking at this guy's articles, he's a cynical software engineer, not exactly a supervisor. He's just describing the process of gaining engineering experience in a field that demands good experience if you even want to get to the interview. An injoke over on /sci/ is that engineers literally suck dick, and who can blame them?

For one, SpaceX is guilty of all of these things, the sweatshop of engineers, just because young people look to them with wide eyes. The understaffing part doesn't even mean hiring less engineers, either. In an ENTRY-LEVEL interview, I'd been asked about my supervisory & managerial experience because they'd want me to implement changes at the machine operator level, but at other sites, the very same company actually has supervisors on staff to do that. I know because I interviewed for both sites, for the very same position title, less than a week apart.

People put up with it just to get their foot in the door, which is getting harder by the day.
>>
File: Art of manipulation.png (15KB, 784x30px) Image search: [Google]
Art of manipulation.png
15KB, 784x30px
>>61106759

>The Desolation of Blog

Lmao what's this anon
>>
>>61100635
>Most places have asked me to start within two weeks, especially if they're planning on firing you after six months.
what?
no really, please elaborate
>>
How does free code camp compare to the Odin project?
>>
>>61107548
My first job, the company that hired me was in a shift, they had new jobs from the same old clients and a vacancy. They hired me, I worked on the job, finished it relatively quickly, and bug fixed their main system, but after six months they fired me. Obviously no new jobs came in.

At the start, they kept saying I was on "probation," that's your first clue. The next is there's an entire project waiting for you, which isn't a big clue but a bit of one. Another clue is if they talk about returning past employees, especially if you hear the word "maternity."

What seemed to happen was they wanted to "expand" (self owned business, read: director wants to buy more expensive wine) so their clients gave them more work, which I did, caused some profit but they decided it wasn't enough considering the ex-employee was coming back. Coupling that with the political climate of the clients they were dealing with, it could have even been that I was a white male, which if true I'd hold against their clients rather than them to be honest.

But yeah, the more I think of it, the more I realise how likely they wanted to keep me on only for a short enough period to do that job (a financial system with SSH), kick me out, have six months with 3 employees instead of 4. Sometimes I felt like I was being tested? I'm wondering if their idea was that I was a crash test dummy for this woman coming back?
>>
>>61107807
>woman
>doing any kind of dev
what country are you in?
>>
>>61108090
I believe the table name is getting escaped inside quotes, validate the name in your client script instead.
Also, there must be a way to print the whole query, for debugging purposes.
>>
>>61108172
it wont work when i use ? for table name.
After adding `'.$table.'` everything was fine
>>
What is your favourite book on react?
>>
>>61107807
Small startup companies like that cut all sorts of corners when it comes to expensive skilled labor. It's a small enough company that no one really cares to listen when they do some shady shit, so even if you file a report, either no one's gonna look at it or it'll cost more money than it takes to take action. Those small shady kinds of companies tend not to grow much, though.
>>
File: 1495995318691.jpg (106KB, 1080x1080px) Image search: [Google]
1495995318691.jpg
106KB, 1080x1080px
can anyone suggest any cool side project I can make with D3.js ?
>>
>DELETE FROM ? WHERE id = ?
DELETE * FROM ? WHERE id = ?
>>
>>61109368
wat
>>
>>61109449
Dude asked whats wrong with his sql but he deleted the post and i also forgot to link it.
>>
>>61108335
>book
>>
How do I turn an express app into a module that I can then require in my app and still modify the templates? is that possible?
>>
>>61108335
"Google on one screen, editor on another, and just like start a React project: The Book"
>>
>>61109906
or could I get by with just git? basically I want to make a website/app that I can deploy multiple instances of and be able to update the templates/static assets manually for each instance but keep the core codebase the same.
>>
My new job uses a mac with 1 monitor.

I am getting sick thinking about it. I forgot there were people that had only 1 monitor.

Oh my god I don't even know what kind of chair I will have. Probably some 20 dollar Wal-Mart chair.
>>
>>61109455
Delete doesn't need an asterisk.
>>
>>61107807
This is kind of scary.
I just got hired in a situation like this and I'm relocating to work there. I will be so fucked if they fire me because It's out in the middle of nowhere.
They doubled their clients in the last year and are finally expanding nationally. They say they are about to open a few support centers around the US.

Isn't a 3 month review pretty standard? I've always had them.
>>
>>61109268
image analyzer, that graphs the amount of gayness in your shitpost images over time

>>61109906
>>61110021
sure why not
make a repo, that you use as a starter
>>
Were they authorised to move furniture into the place where SQL was invented or was it too much a risk that somebody would drop a table?
>>
>>61110335
but how do I manage updates to the core codebase without wiping out my changes to the views/assets?
>>
>>61110021
You're talking about putting together an override structure.

I'm not a big node/express engineer, but this is a common problem in software engineering. The solution generally looks like this:

1. Put your engine into a library (probably an npm package on a private npm repository, your base express application).
2. Make that engine easily configurable. There are a bunch of ways to do this, you can make it automatically look at pre-defined directories in whatever project you include it into, or, more likely, you can pass a configuration object to the main function you export from the library containing whatever. A set of paths, probably.
3. Eventually realize that you're better off with a monorepo.
>>
>want to try building a decent site and server
>tfw there are six gorillion packages and frameworks that people use and I don't know which ones to use if I'm just trying things out
>>
>>61110394
Just pick one. Don't get stuck in analysis paralysis. There's not some holy grail correct choice.
>>
>>61110141
Could be worse, at my last job we had desktop computers, then my boss wanted us to use MacOS as he had a MacbookPro, so he changed our computers for 2014 dual core Mac Minis which perform as notebooks. We enjoyed the silence of the minis but despised the hangs and kernel panics we got.
>>
>>61110394
start with something small like sinatra/flask/express and just go to town. before using any library/framework beyond that, first research how to do what you're trying to do without a library/framework, then analyze the pros and cons of using that library vs doing it yourself. You'll find the landscape much easier to navigate that way imo.
>>
>>61110394

This >>61110461, don't get carried away by learning Node, webpack, webpack2, React, Vue, bootstrap and bulma at the same time.
>>
>>61110370
thanks anon, your post helped me understand a blog post i found on the topic.
>>
>>61107419
Out of curiosity what sites did you interview at? And for what kind of positions?
>>
var w = 300;
var h = 150;
var padding = 2;
var dataset =[5, 10, 15, 20, 25];
var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);

function colorPicker(v){
if (v<=20) { return "#666666"; }
else if (v>20) { return "#FF0033"; }
}

svg.selectAll("rect")
.data(dataset)
.enter()
.append("rect")
.attr("x", function(d, i) { return (i*(w/dataset.length)); })
.attr("y", function(d) { return h-(d*4); })
.attr("width", w/dataset.length-padding)
.attr("height", function(d) { return d*4;})
.attr("fill", function(d){
return colorPicker(d);
});

svg.selectAll("text")
.data(dataset)
.enter()
.append("text")
.attr({
"text-anchor":"middle",
x: function(d, i) {return i* (w / dataset.length);},
y: function(d) {return h - (d*4); }
});


anyone know D3.js and can tell me why the text-anchor (last attr) doesnt work?
>>
copy-pasting my /dpt/ question here because I forgot they were very autistic. I know its not web-dev but I figure someone here could give some advice.

doing a super basic IT internship right now. I told the guy I'm pretty good with excel and he assumed I'm a guru and wants to have me automate the offices stuff. So now I'm teaching myself VBA as I do my IT functions and automating some calendar bullshit. I'm hoping to get more and more stuff to automate after this.

How should I rewrite my job title on my resume if I end up becoming the company script wizard? Also any good VBA book suggestions?
>>
>>61111403
Forgot to add a
.text(function(d) {return d; })
before the last .attr

still doesnt work
>>
>>61111456
Try using text-anchor alone in another .attr("text-anchor", "middle")
>>
>>61111456
What do you mean doesn't work. Like it errors out or it doesn't append the attribute.
>>
>>61111432
make a free microsoft account that gives you access to 3 months of free pluralsight, learn it there
>>
>>61111477
.attr({"text-anchor": "middle"})
.attr({
x: function(d, i) {return i* (w / dataset.length);},
y: function(d) {return h - (d*4); }
});


is this what you meant? still nothing
>>61111480
it doesn't append.
Check it out

http://jsbin.com/mizikefasa/1/edit?html,js,output
>>
File: nigger.png (17KB, 699x103px) Image search: [Google]
nigger.png
17KB, 699x103px
>>61111522
Seems to work for me.
>>
>>61093413

I'd agree with the notion that frameworks make most sense in a work-environment. since it is the place where you can really focus on learning a framework without distraction.

at my work we are hesitant to employ any frameworks though because of the "what if it will not get supported anymore?" or "it makes everything too confusing".

one of my greatest fears is that I will become unable to adapt as a developer because of it.
>>
>>61111399
Process engineering positions at Mohawk carpet manufacturing. It's not really endemic to the particular company, either; it's more of something that does or doesn't happen depending on how that particular location is being managed. Different management bloc, different circumstances.
>>
>>61112181
Apologies, I completely misread your post. Since you mentioned SpaceX I assumed you were talking about interviewing there.

I agree that companies tend to take advantage of young starry eyed engineers, and while SpaceX does this to a degree, I think overall the engineering/scientific staff here is taken care of pretty well. Particularly in the last few years, we did go through some rather rough growing pains early on that lasted longer than it should have.

I work here as a technician so obviously I may be somewhat biased.
>>
>>61111432
You mean your job title in like the work experience section? Do you really want to change your job title to excel monkey? What's your current title? It should probably just be IT Intern. But you should have a breakdown of what your responsibilities were, what you learned, how you generated value. That kind of stuff definitely looks good on a resume. Maybe not so relevant for a programming position, but certainly for officey jobs.
>>
>>61111998
When that happens you can just specialize in a querying language. I've seen jobs in Texas paying 80 an hour for SQL programmers and 70 an hour for postgres.
>>
>>61112776
>You mean your job title in like the work experience section?
Yes, I'm currently just IT intern. I've got a year left for my degree and couldn't get a dev internship so I settled with this. Next year I'm going to want to apply for webdev positions though so I want to find a way to cram the scripting into my resume since this is the only tech related experience i have.
>>
>>61103438
You mean the "revealing module pattern" is an encapsulation? Because that's a revealing module pattern. Ultra-private
>>
File: rundown.png (227KB, 559x397px) Image search: [Google]
rundown.png
227KB, 559x397px
I am trying to create a sticky element with this
http://imakewebthings.com/waypoints/shortcuts/sticky-elements/

<!DOCTYPE html>
<html>
<head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="/scripts/lib/noframework.waypoints.min.js"></script>
<script src="/scripts/lib/jquery.waypoints.min.js"></script>
<script src="/scripts/shortcuts/shortcuts/sticky.min.js"></script>

<script>
var sticky = new Waypoint.Sticky({
element: $('.basic-sticky-example')[0]
})
</script>

</head>
<body>

<div class ="basic-sticky-example">
<h1>STICK ME TO THE TOP</h1>
</div>

<p>A line of text...</p>
[Many lines here]
<p>A line of text...</p>

</body>
</html>


Why doesn't this work?
>>
>>61114080
You don't need Waypoints for a basic jQuery sticky. But don't forget phone users.
>>
>>61114190
Could you show me how to achieve it? There would actually one element before sticky div, I want it to slide off and then sticky to stick. Yes, sticky is easily done with a simple css class, but I want the same effect as shown in the link.
>>
wtf why did .09 turn into that shit? Th-thanks javascript.

Total revolutions left: 3.09
doing 100%
Total revolutions left: 2.09
doing 100%
Total revolutions left: 1.0899999999999999
doing 100%
Total revolutions left: 0.08999999999999986
doing 8.999999999999986%
>>
>>61108112
Anglophone western.

Over here, if a woman, especially a non white woman, asks for your job politely and you have a STEM job you just have to lose your job and become unemployed or else every man everywhere becomes irredeemably sexist.

I've seen her commits, trust me she's not a meritocratic hire. It literally is woman arbitrarily deciding to come back from 3 years maternity leave, I can't even get it that long on democracy 3 and I can ban homosexuality in that game.

>>61108962
Quite the opposite, their clients might have taken notice and it's distantly possible they even said that they refuse to give work to a white man programming, especially if he's young. In this case, I actually blame their cuck clients instead who in some cases were openly Marxist.

In this business, the dodgy was hiring me in the first place because I'm a white male!

>>61110251
>They doubled their clients in the last year and are finally expanding nationally.
They might not fire you.

In my case, it was the same clients but more work. After the work was done, it was back to bug fixing and maintainance, which they obviously decided was easy enough to kick me out.
>>
>>61114221
Google found this example: http://w3bits.com/simple-sticky-scroll/
All that is missing is the screen width check for mobile users.
>>61114236
If you are sure the variable is a number, use myVar.toFixed(2)
>>
>>61114310
K, thank you, but what if I specifically want to use that waypoint library?
How to make it work.
>>
>>61114330
$('.basic-sticky-example')[0] returns undefined because the script was executed before the div was added to the dom.
>>
Anyone here using stripe as their primary datastore? I'm talking about the products/sku apis that let you store and retrieve products and their variants.
>>
>>61114362
Equally ain't working if put before </body>, so?
>>
>>61114417
Hmm, maybe the css rules are missing, check the docs.
>>
>>61114362
>>61114417
While you should definitely run the script after the DOM elements (i.e., right before the end </body>), you may also need to wrap the resultant element in another jquery selector. I know this sounds hacky, but I'm sorta wondering if the sticky library requires a jquery element? Doing $('.basic-sticky-example')[0] actually returns the raw DOM element (or... seems to), not the jQuery selector. So if the waypoint library is doing something like $(el).scrollTop(), it's gonna return undefined. So:
//assume there are a bunch of <p> elements on the page. At least... say 5 or so.
$('p')[2].hide(100);//fails, because $('p')[2] is a DOM element, NOT a jQuery object.
$($('p')[2]).hide(100);//does not fail, because it first converts the DOM element to a jQuery object.
>>
Hey, OP
if you're still around, throw codility in with the challenges.
Has some basic default ones and they have some timed challenges every few months.
link:
https://codility.com/programmers/challenges/
>>
>this css

end me

How can I get the text to fit the div no matter what?

I'm trying to use jQuery QuickFit but this is the result.
>>
>>61115205
if the text is too big what do you want to happen?
>>
>>61115211
users can select many different font types, I need it to always be in the div at max width.
>>
>>61115221
right but what do you want it to look like if the text is too long
>>
>>61115232
shorter text, so it fits.
>>
>>61115205
>>61115239
flexbox

If you're using javascript for this, you're doing it wrong
>>
>>61115251
I have a set width div that contains the text.

What am I flex boxing? I can't set font-size: flex

I just snapped my finger and typing fucking hurts.
>>
>>61115421
You have a fixed size container and a text size chosen by the user and you need to make them fit? Unless you want to ignore the user's input, you can't do that.
>>
>>61115205
https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript#answer-21015393
>>
>>61115251
If the width of the box is arbitrary and he's trying to scale the text accordingly then he has to use JS. He has to measure the text width and scale accordingly.
>>
>>61115569
It doesn't sound like the width of the box is arbitrary. It sounds like it's a fixed width box but the font can be changed, and some wider fonts overflow the box
>>
>>61115470
Would I not be able to detect the text divs width and then increase the font size, repeating until it fits properly?

A hacky approach to CSS in 2017, who'd have thunk it?
>>
>>61115640
Anyways, I think I'm going to do this since everything else sucks.

I could make it 1 font and size it static to fit, but there is no fun in that and the things I make are customizable.
>>
>>61115606
Same problem.
>>
>>61115205
https://codepen.io/anon/pen/VWrJbg/
>>
>>61100968
Entity Framework is too slow. Roll your own SqlDataReader
>>
Is SASS/SCSS not considered best practice anymore? What has replaced it
>>
>>61116005
No, it's fine. SASS/SCSS or LESS is fine.
>>
File: 1494465289368.jpg (27KB, 383x393px) Image search: [Google]
1494465289368.jpg
27KB, 383x393px
I made chiru.no
>>
>>61115779
That's not even close.
>>
>>61116005
>>61116017
SASS is way better than less in my opinion.
>>
>>61116004
People use SQL because the queries can make some things easier with nicer code especially in C# and Java, if all I cared about was speed I'd use redis and end of discussion because that responds faster than almost every web framework.

I don't mind poorly managed data if everything is stored as JSON strings at least. Worst case scenario is I cast everything and check for nulls. I recommend sql for the linq statements, it's not my fault your dumbass database has tables with billions of entries.

>when there's a table named after a popular buzzword at the company
..huh

Same guy as before, another reason I was hired was to look at this problem, yet another indication of a short term thing. Problem was simple, the database was designed by a guy who gave in to the clients every turn right down to the terminology used, which meant labelling 90% of the data the same thing, to the point everything started slowing down.

They thought a rewrite would fix the fact their server takes seconds to respond, but at best you could get 40ms like that and it was obvious. What actually needed to happen was the database designer (also the senior dev) needed to fragment each table so nothing has more than a few thousand records, at that point your server will always respond under 50ms unless you're using an unadvised language.

Conclusion, SQL is fine just watch the table size. Redis is even better if you genuinenly actually need three tables with a billion record each. These guys had 3 separate billion record tables and hundreds of associated tables, meaning I'd need a double check every time I worked with SQL because there were multiple tables describing the same thing and there were multiple ways of doing things but only one current design pattern.
>>
File: 1386104188460.jpg (47KB, 999x766px) Image search: [Google]
1386104188460.jpg
47KB, 999x766px
anyone here good at unit testing in angular 2?

I am having a bitching time trying to get 100% code coverage on Jasmine on shit like observables and catch blocks.

for instance my service calls all have a catch block that none of my tests are hitting even though I send a proper rejection with a 404 status and error message.

what's worse is I have a component with a bunch of private functions that uses observables.forkjoin and I can't for the life of me get my unit testing code to fucking hit the private functions in there.
>>
>>61116232
Yeh, I like SASS/SCSS more anyway. But no, they're not deprecated or anything.
>>
>>61115205
how about https://codepen.io/anon/pen/GEOVPv
>>
>>61115205
https://www.w3schools.com/cssref/playit.asp?filename=playcss_overflow

Is this what you're looking for? Auto only shows the scroll bar when the text overflows.
>>
>>61115205
Play with overflow?
>>
Uploaded my C# templating engine manager / cached server side rendering library.

https://www.nuget.org/packages/FAP.React/0.0.6
Install-Package FAP.React


Future features will probably be sass/less precompilation/caching and then the real reason for this whole exploit, a global CreateSite function that loads all css, .less, jsx, html, everything just from a folder. The issue here so far has been linking the css routes to sources in html files, this is because I have no way of knowing the real path of your backend.

Like, I dunno if you've configured
/api/css/main.css
or
/backend/main.css

The fix here could be that you tell me, like:
new Server(FEngine.CreateSite("folder"),"api");

I don't like this, because it relies on some sort of agreement that I can always refer to routes like /api/main.css or /api/main.html regardless of whatever you pick for your front facing server, which is necessary because I'll never find an acceptable way to decrypt a stream efficiently in my code (for HTTPS). I don't trust you and I refuse to implement HTTPS/SSL foolery because I trust you even less to handle keys correctly.

Otherwise, it is an acceptable solution to a single line backend for C# though, just not HTTP1.2. If Python fags can be "pythonic" by having great libraries so can C#.

This is ultimately in the top three most efficient ways to get SEO without using C++, without aggressively caching node.js yourself (you could even copy my code, it'll be faster than mine truth be told) and without any configuration files necessary (although tsconfig is nice), because I might be wrong about this but fuck configuration files. Rely on debugging/console output and a decent javascript IDE, but fuck the bazillion configuration and resource files most frameworks have.

Now enjoy ridiculously fast load times.
>>
>>61117478
>
new Server(FEngine.CreateSite("folder"),"api");

Better as:
new Server(FEngine.CreateSite("folder","api"));

And I'd (same guy) would just modify all the sources to css files I've assumed apply to each file, or I can just paste the css directly into the output like I did earlier, but then I wouldn't be able to use actual CssPages so you can pass objects into less and sass from C#. I've seen some projects where css stuff comes from the database, but they instead took the filename, this way cached css can have certain things like theme colours come from a database but otherwise process normally in less/sass.

It's definitely doable like that above. It's unfortunate, I wrote this library because I hate front end development and now I've enabled nothing but front end development. Everything is hotloaded so you could just leave that running fivever and only ever shut it down when you add files. My library sucks.
>>
Coming from a vue.js background I decided to try out react. Why is there no docs on how to implement JSON data? I've already loaded the json but when it comes to passing the data it doesnt work

I tried
class RkFetcher extends React.Component {
constructor(props) {
super(props);
this.state = {
msg: 'default'
};

// binders
this.fetchJSON = this.fetchJSON.bind(this);
this.refreshItems = this.refreshItems.bind(this);
}

// lifecycle hooks
componentDidMount() {
console.log("componentDidMount");
this.fetchJSON();

}

fetchJSON() {
const jsonUrl = "./src/js/ajax/ui.json";
let self = this;
fetch(jsonUrl)
.then(checkStatus)
.then(parseJSON)
.then(function (data) {
store.msg = data.ui;
self.refreshItems();
})
.catch(function (error) {
console.log('request failed', error);
});
}

refreshItems() {
this.setState(prevState => ({
msg: store.msg
}));
}

render() {
return (
<div>
<p>{this.state.msg}</p>
</div>
);
}
}

ReactDOM.render(
<RkFetcher />,
document.getElementById('root')
);


I googled and all I found are clickbait advert-infested pajeet blogs with no actual details and doesnt work.

This is bullshit!
>>
>>61117626
>fetch
Please, just use jquery.

JSON will come back from the server as expected in javascript despite being babel or not.
>>
trying to do something I see replicated all the time but im having a hard time achieving:

I have table, php code takes rows from sql db and echos out the table contents, they are list of jobs and I want it so that a user can click a button to the side of each row and then they are assigned to that job. the problem im getting to is that the buttons have to have a dynamic id number, which isn't hard to do, but when I have the button function in php I can't really figure out how I'll handle different buttons that aren't predefined.. sure this makes no sense but thought id ask. I am a complete noob at this btw.
>>
>>61117644
jquery your ass, pajeet!

I'm using the whatwg-fetch by github. Not the generic one. And its not about fetching the data.
The data is already "fetched". I just need to pass the "fetched" data into the state
>>
>>61117682
Whatever dude, either iterate through your data and set the state like that or fuck off, it's almost never that data can come from the server straight into the state.
>>
>>61117478
>>61117577
Same guy.

After accidentally fucking something up, which is what happens if you care too much about efficiency, it's now up on nuget.

Interestingly, it's the only moustache.js implementation on nuget and probably the only C# implementation of a few other templating libraries, but most of them have multiple nuget packages.
>>
>>61117626
What the fuck are you even trying to do? "Implement JSON data?" What does that even mean?
>>
>>61106033
You copypasted a React tutorial.
I know because they are a bunch of hipster faggots using the spread operator and at the same time using an ugly as fuck switch case.
>>
I am making a website that has only 1 thing to do.
Display a list of data in a table.
Should the filtering be done client side or through the queries sent to the server?
>>
>>61117626
Don't use fetch, use axios. fetch use case for anything other than get() is weird. Instead axios has sane methods (post, put, delete).
axios.post(url, data)
.then(response => {
})
.catch(err => {
})
>>
>>61118448
Can axios validate and do nothing when run by a v8 instance? If not, it doesn't work as well for me as Ajax.
>>
>>61118427
both. your main endpoint responds with both html or json. first request send html, using javascript override the buttons/form with an ajax request with json accept header, then update the table with your json. this way you get the benefits of javascript but it will still function without javascript.
>>
File: phpgame4.png (82KB, 1273x425px) Image search: [Google]
phpgame4.png
82KB, 1273x425px
So what I wish to implement here is a simple jQuery toggle effect where the user clicks on a country on the left and it shows the info for that country, then if they click that country again (i.e. click 'off') then the standard default text appears (explaining how the game works etc).

What is the most effective way to do this - do I have to write all of the countries' profiles in the same document, wrap them in spans or divs and hide them all by default, to be toggled on individually as the user requests? Will that method mean the page will take a while to load?
>>
>>61119405
man, why aren't you using Vue or React for this?

but otherwise, keep an object with the countries information and update the div with data from that, depending on which button is clicked
>>
>>61087877
I want to use HTML/case/js with electron to make desktop apps that are fluid and beautiful. I also want the website to have a similar look and feel with a little less animation. Eventually I'd like to port over to Linux.

Is this a good path to learn? I used to use C++ and Java for games and really have very little experience outside high school C# when it comes to desktop applications. It definitely seems that traditional languages aren't the way to go in 2017 and I'd like to start building a portfolio to get out of my shitty security job.
>>
>>61119478
>man, why aren't you using Vue or React for this?
lol why should I
>>
I'm using this
https://pastebin.com/z1jRXxXd
To generate links to DLsite based on its code number, however the link doesn't follow the :visited Selector on the websites.

How do I add it?
>>
>>61119585
>do I have to write all of the countries' profiles in the same document, wrap them in spans or divs and hide them all by default, to be toggled on individually as the user requests?

because it looks like the way you go about it currently will most likely give you issues in the long run with readability and maintainability.
Admittedly I know 0 PHP, so I can't really weigh in on how to do it properly with that one.
The way you described it, it just seemed like a really good candidate for splitting up the different parts into components, that you can show,hide or exchange based on user interaction.
>>
>>61116086
If you ever show that to a potential employer, make sure to scrub all the KKK references
>>
File: psQrMap.gif (2MB, 200x149px) Image search: [Google]
psQrMap.gif
2MB, 200x149px
>>61119855
Yeah, if you want to be hired by an anti-white kike.
>>
>>61116005
>What has replaced it
Post-CSS and React
>>
>>61116005
keep using sass. all the alternatives have serious downsides and none of them has been accepted as The One(tm) yet
>>
How do I make an automated menu in HTLM from a folder structure, with the same names and all.
I saw some things using Jekyll but I'd like to do it with "normal" means.
Is there a way ?
>>
>>61096200
>Please recommend a nice PHP ORM.
Ignore all the other answers and use RedbeanPHP.
It's the best for simple projects, can magically add columns and alter tables. IMHO it's the best prototyping and light use orm.
Also the library is compiled in a single php, unlike all the other cocksucking faggots out there.
>>
>>61120211
write a script that reads your folder structure and outputs html
>>
>>61120342
Oh thanks I didn't think of that.
>>
Why people say that sql is programming language
>>
>>61116442
I'm digging this. I'll test when I get home, thanks.
>>
>>61119405
Make it an object and save the toggle state in it.
>>
>>61120557
PL/SQL, T-SQL etc. are programming languages
>>
>>61120557
SQL is the standard language for relational database management systems. Managing databases is something typically done by programmers as part of their jobs. If this bothers you, go see a doctor, you might have autism.
>>
should I use w10 or linux for web dev? any benefits of one against the other?
>>
>>61121676
the one you prefer

it doesn't really matter
>>
>>61121672

this

database management and administration is like one of the most important parts of programming, unless youre a babby front end developer
>>
>>61120557
>A programming language is a formal language that specifies a set of instructions that can be used to produce various kinds of output. Programming languages generally consist of instructions for a computer. Programming languages can be used to create programs that implement specific algorithms.

Tell me which part of that definition SQL doesn't meet, and I'll tell you why you're a moron.
>>
>>61121744
>Programming languages can be used to create programs that implement specific algorithms
Just curious how SQL does that.
Or do excel formulas fall under programming language category as well?
What about HTML?
>>
is it possible for PHP to read a file on a server far, far away? i have the ip of the server and username and password
>>
>>61121744
It's not turing complete, so there are many algorithms that cannot be implemented in SQL.
>>
>>61122180
http://www.valuedlessons.com/2009/08/sql-is-now-turing-complete.html
sql is turing complete, even without extensions that I think most people assume the person mentioning "sql" is talking about
>>
>>61121977
>A program is a set of instructions used to control the behavior of a machine.

So an SQL script is a program. You can have them simple (an ordinary select) or very complex, combing through several tables, matching different variables and combining and rearranging results. Agree or not?

>specific algorithms
an index search on SQL does a binary tree search (at least MySQL does so, depending on the engine you're using), whereas a regular search does a serial search. Different algorithms being implemented depending on your SQL query.

I'd say this satisfies the broad definition of 'programming language'. Then you ask about excel formulas and HTML. Those do meet the broad definition, of course, but what you're trying to say is, are they *really* a programming language? So given a narrower definition (I have no idea how that would go about), maybe not.

But your narrow definition of programming language would be based, I assume, on what "real programmers" do, and like anon said here >>61121716, I would say any narrow definition of 'programming language' would have to include SQL. Unless you want to argue the case that "real programmers" spend a large amount of their time doing something that is not considered "real programming".
>>
>>61122314
>an index search on SQL does a binary tree search (at least MySQL does so, depending on the engine you're using), whereas a regular search does a serial search. Different algorithms being implemented depending on your SQL query.
this is completely irrelevant. the searching algorithms are implemented in the languages that the rdbms is written in (so mostly C++ or Java). unless you know a rdbms implemented in sql
>>
Alright faggots, any javascriptkiddies in here who can help me out?

I am trying to create a list with elements containing different variables. Now I need to make a filter to hide/show these elements depending on if they have these variables or not.
What is the best way to do this? I am moderately experienced with HTML and CSS but still novice at Javascript, but I understand the basics.

Should be rather simple so I figure there would be someone on this board who knows how to do this.
>>
Writing my backend with Java EE I was wondering, it says that for every incoming connection, it creates a thread to handle said connection. When I have like 400 connections, that means I have 400 threads. Isn't that bullshit? I'm not running this on a toaster but the cpu has 4 cores so what's the point of 400 threads.
>>
>>61123031
you seem to be optimizing prematurely. do you have a performance problem?
>>
File: machine_learning.png (28KB, 371x439px) Image search: [Google]
machine_learning.png
28KB, 371x439px
What is the best IDE with browser window (better with multiple useragents), so whenever I change a line of code, browser window is refreshed?
>>
>>61123341
you don't need an ide. all you need is a web browser and something like livereload.com/node-livereload/webpack-dev-server
>>
need help with free codecamp chunky Monkey challenge
Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a two-dimensional array.

Remember to use Read-Search-Ask if you get stuck. Write your own code.

Here are some helpful links:

Array.prototype.push()
Array.prototype.slice()


chunkArrayInGroups(["a", "b", "c", "d"], 2) should return [["a", "b"], ["c", "d"]].
chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3) should return [[0, 1, 2], [3, 4, 5]].
chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2) should return [[0, 1], [2, 3], [4, 5]].
chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]].
chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3) should return [[0, 1, 2], [3, 4, 5], [6]].
chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4) should return [[0, 1, 2, 3], [4, 5, 6, 7], [8]].
chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2) should return [[0, 1], [2, 3], [4, 5], [6, 7], [8]].


Here i tried
 
function chunkArrayInGroups(arr, size) {

// for (i= 0; i<arr.length; i++) { // also works for assoc. arrays
// b = arr.slice(size);
// }
//return b;
var b = [];
for (i=0;i<arr.length;i++) {
var d = arr.slice(0, size);
b.push(d);
return b;
}
}

chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2);
>>
>>61117654
Bump
>>
>>61122949
Already told you. Make each list item an object. You can then save the toggle state to it.
>>
>>61123515
function chunkArrayInGroups(arr, size) {
const groups = [];

for (var i = 0; i < arr.length; i += size) {
groups.push(arr.slice(i, i + size));
}

return groups;
}


>>61123768
have the buttons be links to something like assign.php?id=X where X is the job id
>>
I have php function which select something from database and output it with button near it with id="id" and value="Value from database"
and i have script which should prompt Please enter price for 'value' attribute.
Problem is if there is 10 elements, and let value of 1st be value="Element"
if i click on any other element, they all have same value
here is script https://jsbin.com/mimoyaxuvo/edit?html,output
>>
>>61123998
https://jsbin.com/hegevikeno/edit?html,output
like so?
>>
>>61124523
>new thread
>>61124523
Thread posts: 321
Thread images: 26


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.