[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: 327
Thread images: 38

File: 3.png (868KB, 822x552px) Image search: [Google]
3.png
868KB, 822x552px
/wdg/ - Web Development General

Previous Thread: >>57542617

> Discord
https://discord.gg/wdg
OR
https://discord.gg/0qLTzz5potDFXfdT
(they're the same)

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

>Learning material
https://www.codecademy.com/
https://www.bento.io/
https://programming-motherfucker.com/
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md
https://www.theodinproject.com/
https://www.freecodecamp.com/
http://www.w3schools.com/
https://developer.mozilla.org/
http://www.codewars.com/

>Useful Youtube channels
derekbanas
thenewboston
learncodeacademy
funfunfunction
computerphile
codingrainbow

>Frontend development
https://github.com/dypsilon/frontend-dev-bookmarks

>Backend development
https://en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks
[Gist] backendDevelopmentBookmarks.md

>Useful tools
https://pastebin.com/q5nB1Npt/
https://libraries.io/ - Discover new open source libraries, modules and frameworks and keep track of ones you depend upon.
https://developer.mozilla.org/en-US/docs/Web - Guides for HTML, CSS, JS, Web APIs & more.
http://www.programmableweb.com/ - List of public APIs

>NEET guide to web dev employment
https://pastebin.com/4YeJAUbT/

>How to get started
http://pastebin.com/pDT82mQS

>cheap vps hosting in most western locations
https://lowendbox.com
https://www.digitalocean.com/
https://www.linode.com/
https://www.heroku.com/
https://www.leaseweb.com
>>
>>57566751
I'm guessing you're new at CSS?
>>
File: 1479321655148.jpg (919KB, 3610x1620px) Image search: [Google]
1479321655148.jpg
919KB, 3610x1620px
The Study Group is up again.

We're on gitter now. Great progress! Send mail at mauser91 protonmail.com
for invite + more info
>>
>>57567638
>my email wont be sold to chinese spam bots
Kek.
>>
please, i just want the TL;DR answer to this:

can i use a normal website as the backend of a simple mobile app? users can make accounts and upload small files. the users and their files are visible to other users. there is simple server-side logic to verify the integrity of the files and for administration.

can i use a normal web host (intended for websites), with php and a mysql database to accomplish this, instead of paying extra for a cloud service?
>>
>>57568366
Are you retarded? Yes.
>>
>>57568421
thanks for the answer. it seems obvious but when i try to google it they just talk about google app engine and amazon aws and other cloud services (or even hosting your own server) and all kinds of stacks that won't run on a normal web host
>>
What Linux dist is the best for webdev? Is it still Ubuntu? I've also heard of Linux Mint, but I'm an absolute noob in Linux topic so I have no idea what I'm talking about.

For this reason I'd like it to have the most newbie-friendly and windows-like interface, while not sacrificing any development capabilities.
>>
>>57568366

Yes.
>>
>>57568617
Kubuntu.
>>
wat do with domain name wavs.io?
>>
>>57569223
Input/Output WAVs.
>>
>>57569223
war apes versus interstellar orchids
>>
Is it safe to allow users to upload anything they want to the server as long as the files don't have execution permissions on them? even scripts or executable?
>>
>>57569783
No.
You can't handle files as if they had some special meaning on your HTTP server.
So it means no .php or other interpreted files, if you handle it. You need to send them with Content-Type: application/octet-stream (so they will be downloaded by client) or with text/plain MIME (to be displayed as text). Same applies to HTML files, unless you want to really serve them and risk running any JS on the client receiving it (which means the running script gets access to all cookies for your domain and local storage). SVG files can have embedded scripts, too.
>>
>>57569118
>Kubuntu instead of KDE Neon
>>
what textbooks should I read?
I already have Javascript the goodparts, what others are good?
>>
>>57569945
https://github.com/getify/You-Dont-Know-JS
http://eloquentjavascript.net/
>>
>>57569993

thanks famalam
>>
Any help here pls. It doesn't remove _over when mouse leave, just keep adding _over when hover
(function ($) {
$(document).ready(function(){
$(".test").hover(function() {
var img = $(this).find("img");
var src = img.attr("src").match(/[^\.]+/) + "_over.png";
img.attr("src", src);
});

$(".test").mouseleave(function() {
var img = $(this).find("img");
var src = img.attr("src").replace("_over.png", ".png");
img.attr("src", src);
});
});
}(jQuery));
>>
>>57572060
Ow shit, found the problem
(function ($) {
$(document).ready(function(){
$(".test").hover(function() {
var img = $(this).find("img");
var src = img.attr("src").match(/[^\.]+/) + "_over.png";
img.attr("src", src);
}, function() {
var img = $(this).find("img");
var src = img.attr("src").replace("_over.png", ".png");
img.attr("src", src);
});
});
}(jQuery));
>>
react or angular? i'm newbie, 20 years old
>>
>>57572388
hey same here famalam
>>
>>57572388
kys
>>57572471
and kys
>>
File: JUST.jpg (14KB, 456x320px) Image search: [Google]
JUST.jpg
14KB, 456x320px
>>57572534
already tried
>>
>>57572388
if you just want a view layer and write the rest yourself react.
if you want the whole package angular

both are not easy to learn though. prepare to get your shit fucked up
>>
>>57569235
This.
Loke some strange sound social media or a better version of vocaroo.
>>
I'm new to backend development and I want to make an imageboard. Is Django a good place to start?
>>
>>57572843
Why not make something people would want to use instead?
>>
>>57573179
Like what? I'm not very creative
>>
File: 1363999356751.jpg (30KB, 555x644px) Image search: [Google]
1363999356751.jpg
30KB, 555x644px
Friendly reminder that mobile phones perform like dogshit, none of your fancy meme Javascript frameworks will work on them properly, and you're basically a retard if you aren't designing around mobile constraints because it's the largest web browsing platform in the world.

If you care about and are able to make web pages that perform well on mobiles you're automatically better than 99% of the web developers in the world.

https://www.youtube.com/watch?v=4bZvq3nodf4
>>
Any advice on how to pimp a my-account wordpress page for a native dev without much knowledge of the web realm?
>>
>>57573306
got some places where I can learn so I'm better at this shit.
>>
$(document.getElementById("derp"))


vs

$('#derp')


It needs to be a jQuery object, but is letting jQuery find it faster than calling getElementById and then making a jQuery object from that?
>>
http://www.milliondollarhomepage.com/

this would be pretty simple to recreate with canvas. Someone less lazy than me do it.
>>
I created a table with SQLite and gave it a primary key, however i want that primary key to start at a higher number than 1. Is this possible? I have a csv file im trying to import into this table, and it's primary key starts at 4000 something, not 1.
>>
>>57573806
You can set the value you want. I hope you didn't use auto increment for your key?
>>
>>57573806
Are you saying this primary key is auto incrementing?
>>
>>57573717
I think getElementById would be faster since jQuery wouldn't have to analyze the string and then look for the element. I don't think that it really makes a difference though
>>
>>57573846
I'm stuck to jQuery anyway, but I wondered if I could make it depend less on jQuery.

The file probably grows two times in size though, so I'm not sure it's worth.
>>
>>57573861
Maybe this is an option
http://umbrellajs.com/
>>
>>57573942
Nah, it's for fetching RSS feeds and stuff.
>>
>>57573806
You can start your key wherever you want..just use default 1500 or whatever.

>>57573814
You're supposed to use auto_increment.
>>
>>57573819

yes i just want it to start at a higher number
>>
what's a good way to quote the price of devving a webpage for a local business?
>>
>>57574085

im getting a datatype mismatch error (for every row). I created a blank table with the primary key set to auto increment, and its when i try to import the data into it is when i get the errors. The table im importing from i left the primary key cells blank. Im just trying to get the primary key to start at 1 for now, i'll worry about starting it at another number later i just want to get the PK to actually work. First time using SQLite.
>>
>>57568617
Yes, Ubuntu is still the most complete for webdev nowadays.
You can literally apt-get everything in one command.
>>
>>57568617
mint is great as long as youre not worried about the hipness factor/trends.
>>
>>57568617
Mint is fine. Just download the OS and create a live CD from it then boot from CD and you install it just like Windows
>>
Hey, sorry for the basic question.
Is there a best way/book to learn HTML?

Coming from an OOP C++/Java background with no web dev experience. I'm reading the sticky but there is a lot of info.
>>
>>57574528

If you're coming from an actual programming background with ACTUAL experience you'd NEVER ask this question.
>>
>>57573819
insert 4000 blank records, then insert the first record of the csv. Then delete the first 4000
>>
>>57574528
First link in the learning section.
>>
>>57574528

You don't realize how stupid you sound do you.
>>
>>57574572
Or don't be a retard and just set the key's default to 4000.
>>
>>57573717
>It needs to be a jQuery object, but is letting jQuery find it faster than calling getElementById and then making a jQuery object from that?

I think if you're using jQuery you don't really care about performance, so why does it matter?
>>
>>57574605
Retrieving data from Yahoo takes a while anyway, but I don't need it to take long finding the damn thing to put it in.
>>
File: 0048 - W4GQ0Is.jpg (99KB, 850x606px) Image search: [Google]
0048 - W4GQ0Is.jpg
99KB, 850x606px
what js library is the best for making websites?
>>
>>57574660
http://vanilla-js.com/
>>
>>57574660
Depends on the site.
>>
>>57574688

highly recommend this also
>>
File: 0203 - Ftz7l6a.jpg (151KB, 600x849px) Image search: [Google]
0203 - Ftz7l6a.jpg
151KB, 600x849px
>>57574688
>>57574690
displaying a random qt
>>
I figured this would be the best place to ask but whenever I try to access a website it only downloads a file called download or viewtopic.
Any idea what's causing this?
>>
>>57574660
kys.js
>>
I love the White Pages mobile website.
>>
>>57574773
Broken apache server.
>>
File: 0009 - uGAycTO.png (342KB, 850x850px) Image search: [Google]
0009 - uGAycTO.png
342KB, 850x850px
>>57574786
>>
javascript

memeObject[undefined]

what am i accessing? because assigning stuff to it doesn't seem to do anything
>>
>>57574583

ok i got the primary key to start at 4000 and the table looks fine. However after I imported I got one "data mismatch" error on row 1. I have no idea what it is though and if it even matters. All the field are text fields besides the primary key. There are some empty cells from the csv (in other columns besides the primary key) but that shouldnt matter should it?
>>
>>57567046
anyone have some horror stories about their job?
>working on site made in 1990's
>guy who set it up didn't do any code just used Dreamweaver's design section
>whole server is a mess of folders within folders and files
>spent 2 hours today redoing one page because its such a pain to find the right pictures for the page
this would suck if I wasn't getting paid well
>>
>>57574638
then use vanilla js.
>>
File: Screenshot_97.jpg (6KB, 214x87px) Image search: [Google]
Screenshot_97.jpg
6KB, 214x87px
>>57574909
You can assign stuff to it just fine senpai.
>>
Gimp is fucking shit.

I cant even select anything.

Why isnt there a paint clone and why the fuck isnt this a photoshop clone? Ctrl+D should be deselect you fucking autistic dev.
>>
>>57575168
Row 1 are headers in csvs. You need to offset.
unset ($
>>
>>57575591
Thanks dumbfucking 4chan for posting when I didnt tell you to.

unset ($yourarraymap [0]);
>>
>>57572388
Consider Vuejs, I know it's not as big and trendy as those 2 but it's actually quite nice to learn and you don't have to learn shit like JSX.
>>
When I pad a div with borders why the fuck is it padding the inside of the div instead of the div itself.
>>
>>57575579
This subreddit is for programmers who make websites that actually work. Design monkeys have no place here. Off to >>>/gd/ with you
>>
>>57575770
Are you setting any kind of box sizing?
>>
>>57575794
No shit, I'm 6 months the OP here. Trying to make boxes to show my div issues here but gimp sucks.
>>
>>57575486
Enjoy your fucked eyes
>>
>>57575867
I already have glasses
>>
>>57575770
>not knowing the box model
margin - border - padding - content
>>
>>57575258
Maybe write the code again from scratch instead of doing retarded shit like that?
>>
>>57575810
Yes, but no height.

I didn't need it on a previous page where I had a div that gave children divs padding instead of itself for some reason.
>>
>>57575972
>jus rewrite the entire thing :^)
How to spot someone who doesn't do any form of development for a living.
>>
>>57576110
'the entire thing' being a site from the 90's made with Dreamweaver? Guess you'd rather spend 2 hours redoing one page, pajeet.
>>
>>57576210
>implying 2 hours on one page is a long time.
>>
>>57576210
So you'd spend those 2 hours doing a whole new site instead of doing what they asked you to do?

Stay NEET, kiddo. And stop calling people Pajeet when its clear you have zero real-world experience or understanding of technical debt.
>>
>>57575258
Whenever I'm asked to use SOAP.
>>
>>57576604
>Simple Object Access Protocol
>Most convoluted bullshit imaginable

Thanks Microsoft
This is why people just use JSON.
>>
>>57576793
I got a test from an employer asking me to use SOAP. I couldn't find any documentation that made sense.
>>
>>57576887
That's because it doesn't. You just use a 3rd party library written by someone more autistic than you which turns it into something usable, like JSON.
>>
>>57576950
Part of the test was that you can not turn it into json.

I'm being completely serious.
>>
>>57572388
Rupert
>>
>>57576979
Wait wait, you HAVE to turn it into JSON CSV and XML but you can't use something like json_encode
>>
Is it an "API" if I have like 5 of them that specialize in different tasks?

Like 1 for finding something, 1 for posting something etc etc.
>>
>>57577018
Seems that way
The goal of this mini-project is to develop some PHP classes
* that allow Magento product information to be displayed in several
* different formats (CSV, XML, and JSON). Each record should ONLY include
* the sku, product name, price, and short description.
*
* The CSV format must have a header row sku,name,price,short_description
*
* You are not allowed to use any of the built-in PHP encoding functions (i.e. json_encode, SimpleXML, etc)
>>
File: 1475172027593.png (696KB, 633x758px) Image search: [Google]
1475172027593.png
696KB, 633x758px
If I study about 4 hours a day, how long do you think it will take me until I become ready for an entry-level Webdev job?
>>
>>57577191
Once you have a degree or launched full-functional professional project that looks pretty.
>>
>>57577191
depends on how mentally impaired you are
>>
File: 1360405784030.jpg (20KB, 260x269px) Image search: [Google]
1360405784030.jpg
20KB, 260x269px
>>57577110
>* You are not allowed to use any of the built-in PHP encoding functions
LITERALLY WHAT IS THE POINT OF USING PHP THEN?
BUILT-IN FUNCTIONS IS THE WHOLE POINT OF PHP!
>>
>>57577191
You're ready when someone hires you.

You'll be amazed at the monkeys who get paid to do webdev. Just look at the state of the modern web, its clear that standards can't get any lower.

Can you solve fizzbuzz and other algorithm challenges? If so you're already better than a large number of computer science graduates.
>>
>>57577224
They want you to contact an API with a language that is useless in modern dev outside of BEING THE API.

I don't know. I dropped it. This was the only place that responded to me out of 50 and I'm launching a full webpage and app next month.

I have a geolocations API that can run locally that tells you the distance between 2 cities which would be great for apps or websites where people don't want to pay for it like Google Maps API. NO ONE CARES. NO JOBS FOR ME. NO ENTRY-LEVEL. NOPE.

Whatever though.
>>
Has anyone from /wdg/ done the Odin project? How well did it teach you?
>>
>>57577281
>They want you to contact an API with a language that is useless in modern dev outside of BEING THE API.
Hmm... Maybe there's a reason they didn't hire you. PHP is fine for consuming 3rd party APIs, as is any other backend langauge.
>>
>>57577409
They didn't hire me because I didn't even attempt the test.
>>
I'm working with the noodlehaus/dispatch framework to render some pages, so let's say I have a page named 'books' with links to other pages, let's say i.e. 'title/chapter", where chapter refers to a directory and chapter is a number. So for that I would normally do:

get ('/book/title/1', function(){
render('title/1', null, false);
});


Problem with is that I have to repeat this method for every 'chapter', which is a pain in the ass, I would like to identify a certain pattern so if the url contains a number it will render the correct page. I've tried this:

get ('/book/title/:num', function($num){
if ($num > 0) {
$chapter = "title/" . $num;
render($chapter, null, false);
}
});


I have no idea what I'm doing, so it's no surprise it didn't work.

How can I do this?
>>
>>57577303
Just do it and see how well it teaches you. Stop wasting time by asking us to pat you on the back.
>>
File: 1433388294276.jpg (47KB, 354x367px) Image search: [Google]
1433388294276.jpg
47KB, 354x367px
adding a domain name to a private server is harder than writing the entire website what the actual fuck
>>
>>57577548
I'm stuck at getting the nameservers
>>
>feel really good about solving a problem
>literally created another problem for a week over a typo
2bh programming/webdev in general is literally just a test of how fast you can lose your sanity
>>
File: itsshit.png (183KB, 1896x877px) Image search: [Google]
itsshit.png
183KB, 1896x877px
Hey guys. Here's an example of what not to do.
If the page content doesn't load because facebook or google analytics is blocked, something is messed up.

Another example is when a page has 20 external scripts, half of which load more scripts, and the content cannot display without 10 of them. I'm closing that shit instantly.
>>
>>57577790
>using noscript instead of umatrix
*giggles*
you shouldn't be giving anyone advice on anything
>>
>>57577548
Yeah, deployment and server management is an entirely different skillset.
>>
>>57577848
this shit is wild anon
>>
>>57577281
what region(s) are you applying in?
>>
>>57577246
I want to be a code monkey so bad but I make too much $$ in desktop support
>>
>>57577548
>>57577563

when you have a domain . and a private server .
>point domain name to nameservers, that will be included in any private server you buy. If not, contact your provider.
>then create the cpanel with a unique IP (if it is not created).
>wait a couple of hours for DNS to propagate .
>voila!
>>
>>57577790

>when I'm creating WP themes, maximum scripts and files loaded is 4
>2 fonts, 1 js file, 1 css file
>all that's left is those fucking images.
>yeah, laugh it out.
>>
>>57577956
Thanks, I've been trying to set up the nameservers myself
>>
>>57577902
US South. DFW area. The land of no devs and infinite jobs.
>>
>>57578010

No problemfam. they ALWAYS give you your nameservers when you buy a vps. You don't have to configure anything else. Because it would be a risk if they'll let you handle their DNS (which are nameservers, btwfam).
>>
I want to do some proximity amazon wishlist thing.

It would be cool to tap someones phone and buy them something from their wishlist. Or just a GPS proximity where you select from a small list of people.
>>
>>57578136
So do it
>>
>>57578136
not a bad idea, I just feel like there are some security holes, but I can't quite put my finger on it atm
>>
>>57578155
Once I finish this one up I will.
>>
>>57578227
Hope it all goes well anon!
>>
>>57578209
I already checked the APIs and know what to do.

What security issues are you thinking about?
>>
>>57574660
React
>>
>>57572388
React is much better, consider angular 2 if you are interested in Typescript
>>
File: superiorcodingstyle.png (88KB, 890x670px) Image search: [Google]
superiorcodingstyle.png
88KB, 890x670px
Hi guys, newfag here. I know very basic html, css, c++ and java (as in I took high school and freshman college courses). I've looked through the material in the OP and think I'm going to use codecademy to learn more CSS and JS.

I am currently in college and want to do freelance web development from my dorm. If anyone help me by answering these questions it would be much appreciated.

-Should I look for employment to get web development jobs through even if I'm on my own? Is it a lot harder to find customers on my own?
-How long should I spend learning this stuff? It's difficult for me at all and comes easy to me, even though I've barely begun learning the content, so assuming I can learn it at a fast rate, how long do you think this will take me.
-Are there any courses you guys would recommend or even just languages I should start with after JS?

Thanks guys, sorry for looking to leech off your knowledge, but this place seems like a pretty good resource.
>>
How do I get a loan to do nothing but web dev?

I need to leech off the system for a year. Anyone have experience with this?
>>
>>57575258
Rebuild it from scratch with a recent framework :D
>>
>>57576345
2 hours is a very long time if all you're doing is looking for a file in the clusterfuck of Dreamweaver folders, but guess you'd rather just take what I said out of context to sound like you have a point.

>>57576426
The word shocking doesn't even begin to describe your ineptitude, kys pajeet.
>>
why dafuq do I feel dejavu ? Its like I've seen those replies before ...
>>
hardly ever post, just lurk so shrug
>>
>>57582158
/dpt/ is mostly the same bunch of autists who say the same things over and over again
>>
>>57582470

and then there's /wdg/ ...
>>
I'm an electronic engineering graduate who focused mostly on the physics side of the industry (hardware and what not), but I've always wanted my own website where I would write about music and what not - just to scratch that creative itch.

I've just started learning basic HTML, CSS and now JS as well as python (for about a year and I did Java for 2 years as part of my degree), and I've had a lot of fun yesterday after discovering bootstrap.

How long will it take for me to be a jaded fuck like the rest of you?
>>
uint32_t mod15( uint32_t a ) {
a = (a >> 16) + (a & 0xFFFF); /* sum base 2**16 digits */
a = (a >> 8) + (a & 0xFF); /* sum base 2**8 digits */
a = (a >> 4) + (a & 0xF); /* sum base 2**4 digits */
if (a < 15) return a;
if (a < (2 * 15)) return a - 15;
return a - (2 * 15);
}


http://homepage.divms.uiowa.edu/~jones/bcd/mod.shtml#exmod15

this code is wrong but i want to figure this out without having to dig through thick ass research papers. any ideas?
>>
>>57582896 (Me)
uint32_t mod3( uint32_t a ) {
a = (a >> 16) + (a & 0xFFFF); /* sum base 2**16 digits
a <= 0x1FFFE */
a = (a >> 8) + (a & 0xFF); /* sum base 2**8 digits
a <= 0x2FD */
a = (a >> 4) + (a & 0xF); /* sum base 2**4 digits
a <= 0x3C; worst case 0x3B */
a = (a >> 2) + (a & 0x3); /* sum base 2**2 digits
a <= 0x1D; worst case 0x1B */
a = (a >> 2) + (a & 0x3); /* sum base 2**2 digits
a <= 0x9; worst case 0x7 */
a = (a >> 2) + (a & 0x3); /* sum base 2**2 digits
a <= 0x4 */
if (a > 2) a = a - 3;
return a;
}


this has a bit more explanation in the comments, so before the if statements in mod15 it would be 0x3C or 0x3B as the worst case, so 60 or 59, probably just needs one or two more steps to bring it down from 60 or 59
>>
>>57582973 (Me)
this works

uint32_t mod15(uint32_t a) {
a = (a >> 16) + (a & 0xFFFF);
a = (a >> 8) + (a & 0xFF);
a = (a >> 4) + (a & 0xF);
a = (a >> 4) + (a & 0xF);

return a < 15 ? a : a - 15;
}
>>
>>57582896
>>57582973
>>57583116
Welcome do /wdg/, you seem to be in wrong thread.
Unless you write webpages in C, you sick fuck.
>>
>>57583311
oh shit you're right lmao sorry i didn't realize
>>
File: wow.png (97KB, 2093x1096px)
wow.png
97KB, 2093x1096px
>>57575762
> not as big and trendy as those 2
>>
>>57583356
Not as big. 8X as trendy.
>>
>>57574688
This. That framework changed my life.
>>
>>57577664
Static typing does not have this problem. Dynamic typing should not be used for anything besides short scripts.
>>
File: fragzeichenmadchen.jpg (111KB, 500x500px) Image search: [Google]
fragzeichenmadchen.jpg
111KB, 500x500px
In javashit, how to I have a button or any other kind of element invoke a function with specific parameters when clicked?

document.getElementById("myButton").onclick = alert("ass");


doesn't work.

Surely there's a method that most people use, or else buttons wouldn't be very useful at all.
>>
>>57584236
document.getElementById('myButton').addEventListener('click', () => alert('ass'));
>>
>>57584236
document.getElementById("myButton").onclick = function() { alert("ass"); };

If it's inside a form, you need to add "return false;" to <form>'s onsubmit event.
>>
>>57584318
So I have to wrap everything in a thunk? That seems silly.
>>
>>57584331
what do you mean with a thunk?
you can also do
function ass() {
alert('ass');
}

document.getElementById('myButton').addEventListener('click', ass);
>>
>>57584236
Learn functional programming in JavaScript if you're wondering why that doesn't work
>>
>>57584236
have a feeling Im wrong but in my very limited experience onclick is only for defining the event listener inline
>>
>>57584612
You can define the onclick property/attribute in HTML or in JavaScript. An event listener is something different and it can only be defined in JavaScript.
>>
>>57584665
onclick property/attribute defines event listener for this particular event.
They are one and the same.
>>
Why exactly does this not work:

$('.item').click(function() {
$(this).remove();
});

but this does:

$(document).on('click', '.item', function(){$(this).remove();});

It's a section from codecademy which I completed but I didn't really get what the reasoning behind it was.
>>
>>57585063
That's wrong. The onclick attribute is not an event listener.

Onclick:
element.onclick = function;

Event listener:
element.addEventListener("click", function);


You can only have one onclick property, that means if you change it then the previous property gets overwritten, just like a variable.
You can have multiple event listeners.

element.onclick = function_one;
element.onclick = function_two;

Only function_two will be executed here.
element.addEventListener("click", function_one);
element.addEventListener("click", function_two);

Both functions will be executed.
>>
>>57585148
Is the .item added after the event is registered?
>>
>>57585164
Yes, they are the same.
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Older_way_to_register_event_listeners
I don't deny they work differently, because they do. You might be interested in
https://html.spec.whatwg.org/multipage/webappapis.html#events
Especially this part
>When an event handler H of an element or object T implementing the EventTarget interface is first set to a non-null value, the user agent must append an event listener to the list of event listeners associated with T with type set to the event handler event type corresponding to H and callback set to the event handler processing algorithm defined below.

You should use event.onclick if you only have one event handler for this particular element, and if you want an easy way to replace it with another handler.

Your example was incorrect and have not depicted correct usage.

element.onclick = function_one;
element.onclick = function_two;
// same as
element.addEventListener("click", function_one);
element.removeEventListener("click", function_one);
element.addEventListener("click", function_two);

Moreover, one shouldn't use anonymous functions with addEventListener(), because they can not be removed.
>>
>>57585164
Oh, and event.onclick is not the same thing as "onclick" attribute in HTML.
>>
>>57585502
>
element.onclick = function_one;
element.onclick = function_two;
// same as
element.addEventListener("click", function_one);
element.removeEventListener("click", function_one);
element.addEventListener("click", function_two);

Yeah, that was my entire point.
>>
File: 1411701486372.jpg (20KB, 731x565px) Image search: [Google]
1411701486372.jpg
20KB, 731x565px
>>57582138

Script kiddie. Go back to bootcamp now and jerk off about Ruby on Rails. Come back when you have real world experience.
>>
>>57585164
C# has something similar but can += listeners
It's really the superior syntax.
>>
>>57585148
I don't know.

I know that click won't work with elements added to the DOM, but document.on click will. I just switch back and forth like an idiot.
>>
File: 1479524025.png (209KB, 1075x971px) Image search: [Google]
1479524025.png
209KB, 1075x971px
>TL;DR
whats a good approach on making web using some static sites generator framework, with good premade themes offering?

-------------------------------

hey guys, so I have basics of html, css, javascript and jquery and shit that I learned when was mking several various browser extensions for a year. No coffee script though.

Anyway, I never was too big on building websites, while browser extensions really dragged me in, but when I run out of stuff there, I turned to python and I been coding in that for few years not really keeping up with web world, apart from scrapping sites with python for data when needed.

but recently I had an offers on making quick cash just by building and maintaining simple site. I passed, but theres a chance in the future it come up again and I would like to have at that time some basic approach on how to go on about this, what toolset I would use, what themes I would offer.

I read about static sites generators
https://www.smashingmagazine.com/2015/11/modern-static-website-generators-next-big-thing/

I like the idea and outlined benefits as speed, security and simpleness of it.
but how would I go about picking the right, well supported, themed, future reliable framework and how would I go about combining it with bootstrap themes that I quite.
So which framework and any tutorial I should checkout?

I would prefer python ones, but if some in javascript world is making big waves I am ready to reacquaint myself with JS
>>
>working with someone else's CSS
>about 30% of elements use !important

There is a special place in hell for people who do this. Importants are an absolute last resort working with style sheets filled with them is a pain.
>>
>>57585148

Gotta look at it from the DOM point of view.

.click looks through the DOM once and binds it to matching elements.

.on watches the DOM and every time it changes, checks to see if it needs to bind anything to the changed element.
>>
>>57587137
If you care about speed at all, use Hugo.
https://gohugo.io/overview/introduction/
>>
>>57587548
do I need to know Go for it?
or it is just its underlying thing?
>>
>>57587598
You can write more complicated things on top with Go, but generally it's just shuffling resources and configuration files.
>>
File: 1479581850.jpg (237KB, 1475x981px) Image search: [Google]
1479581850.jpg
237KB, 1475x981px
>>57587653
>>57587548
ok, after checking its site, Hugo it is
will spend few weeks trying it out and getting some tutorials under the belt
will be my reference point
thnx
>>
>Message recruiter saying I'm interested in a job
>doesn't respond.

Why the fuck do recruiters do this? Isn't the sole purpose of their business to get people hired?
>>
>>57588108
did you send him your CV, your portfolio, your github?
or did you just send him:
>yo, I am interested in a job bitch, got anything?
>>
>>57588108
it's probably you vs 5000 indians. which company?

on a personal note, i just recently emailed a recruiter two times, with two weeks in between, and then emailed his manager telling i've been trying to get in contact with hr. the next day i get a call from the dude i emailed and instantly got a foot in the door.

getting a job these days is 50% competence, 50% will and persistence.
>>
Trying to learn JS from scratch. Can anyone answer these questions?

1. When and why use function expressions over regular functions?
2. Does hoisting serve any beneficial purpose in real applications/websites?
3. Is 'use strict' recommended for every project?
4. When and why should anyone use let over var?
>>
>>57588183
Cybercoders or whatever.
It's only been 12 hours since I sent the email.
>>57588151
It's for a junior position. I said I can send my resume and my portfolio of completed websites pulling in the mad dosh whenever he's ready.
>>
HTTP/2
Yay?
Nay?
>>
>>57588423
Its a weekend mate who the fuck works weekends
>>
is freecodecamp good?

I have a lot of experience but I'm finding it hard to get a remote job. Most of the stuff that I worked I can't show code or give access to the person hiring because it's mostly erp of big/medium companies, so of course its hard for them to even give me a chance to show what I can do, even if I try to get some junior position (the compensation is still good compared to my country) while being a senior developer.

I was already thinking of learning on my own some of the stuff that they teach there, but I was wondering if it would be a better idea to do it using their platform. I would be learning things, working on project that I could show later and maybe(?) networking and meeting people that could hire me later on.

Is this a good idea or a waste of time? any suggestions?
>>
>>57588477
Meh. Some benefits, but not enough to care.
>>
>>57588423

Oof, cybercoders may generate a lot of leads but they are generally very low quality and they spam the everloving fuck out of you.
>>
>>57588543

I think it is worth it just for the network you gain access to (both for help on projects and professional networking) and for the real-world experience you get when you do their capstone projects with real non-profits.
>>
>>57582477
There's probably a lot more neets in /dpt/ than in /wdg/ because webdev is a commercially viable skillset. Unlike fizzbuzzing in C
>>
>>57588643
>doesn't think that HTTP2 is the shit
How to spot a NEET.
>>
What's the best way to make a web form using SQLite? Need to post and read data from the db. Should I use js or php?
>>
So I've got a job to finish this huge React+Redux frontend project
Problem is, I've never used either before. How do I into?
>>
>>57588643

Being able to send out JS and CSS at the same time as the HTML, in a single request, is a pretty massive benefit.
>>
>>57588416
>function expressions

I hate using them as they create spaghetti-code but you can use it for polymorphic behavior


>hoisting

Again with spaghetti code... I guess you can declare an apps globals all together? I can't see any good use of it to be honest, it'll just confuse the hell out of the poor soul that has to read your code. Hoisting is a quirk of JS, not something you should really use.

>use strict

I've never actually worked on a project that uses strict mode JS. It encourages good coding practices using it I suppose you should always use it but I'm guessing it'll just give you headaches, especially with third party code.

>let over var

When you want more control over namespacing Var = global, Let = limited to the block it's declared in
>>
>>57590297
alright I guess I'll just jump into https://www.youtube.com/watch?v=1w-oQ-i1XB8 to get started
redux seems pretty elegant at a first glance desu
>>
>>57588416
>>57590558
In my opinion you should always use let if you can* because it just makes much more sense and is easier to understand.

*That said, only use let if you're using TypeScript or writing code for Node.js. let is a very new feature and older browsers don't support it.
>>
There is an event at my school for programming and it will involve js and I know absolutely nothing about. I have experience in Java, c, html, php and sql. What are the best resources to give me a crash course in js so I at least have the basics? The event is in two weeks.
>>
>>57590695
codecademy
>>
Uh guys. A question about REST design:

Let's say I have an endpoint GET /items which returns all items and an endpoint GET /items/:item_id which returns only item with id :item_id

Is it a bad design to have the general /items endpoint return less than the specific /items/:item_id endpoint?
e.g. only return id and name with one, but additional info with the other.
>>
File: bandwagon.png (143KB, 600x600px) Image search: [Google]
bandwagon.png
143KB, 600x600px
>>57590318
And it needs manual configuration (Apache), with almost non-existent benefits (less than 1/10 of a second for full page). The benefit is also present only the first time you load page, because any sane browser will cache JS and CSS.
Nginx doesn't support HTTP/2 fully in free version. For programming languages YMMV, but will generally need manual configuration (if the language supports HTTP/2 at all).

From other benefits, minified data is not a benefit –HTTP/1.1 already supported gzip compression, nginx is compressing data on the fly if the file is compressible.

There are no other features worth mentioning, that would be present during normal web usage, not only extremely pathological cases.

You get more benefit by switching from Apache to nginx.

Oh, and you hardly can make use of any of these features if you use CDN or host your JS/CSS on separate domain name due to the inner working of the protocol.

>>57589804
And you read and learn.
>>
>>57591179
Is nginx always better than Apache?
>>
>>57588708
yeah, I'll give it a shot for a couple of weeks to see if its really worth it. thanks anon!
>>
>>57591281
No. Apache got shitload of modules, is pretty easy to use, and is considered the go-to httpd for many webapps. For example setting up Wordpress is much easier on Apache – mainly due to support for .htaccess files. But one needs to be careful with .htaccess files, if it's possible for user to upload files with custom names, it's possible that Apache will execute anything that is uploaded as .htaccess. Apache is also much slower in this regard than nginx, because it checks for .htaccess in every directory from root up to the requested file –nginx does not support .htaccess files, and simply ignores them.

There are obviously many more differences and the question has been discussed many times. You might be interested in these links.
https://www.nginx.com/blog/nginx-vs-apache-our-view/
https://www.digitalocean.com/community/tutorials/apache-vs-nginx-practical-considerations

If you run small website, you might not care at all, as the difference would not be that important. nginx is useful if you handle a lot of connections, for example CloudFlare uses nginx.
>>
File: 1465892945989.jpg (54KB, 556x720px) Image search: [Google]
1465892945989.jpg
54KB, 556x720px
>>57591440
Thanks, Anon
>>
File: smh.gif (3MB, 320x240px) Image search: [Google]
smh.gif
3MB, 320x240px
>>57591179
>And it needs manual configuration (Apache),
You have to configure your webserver manually? How awful.

>with almost non-existent benefits (less than 1/10 of a second for full page).
Optimizing page load time is good for UX and SEO. If 100ms is not a significant portion of your page load time, and you're content with pageloads that take several seconds, you should drink bleach. That 100ms I assume is also on your desktop with a stable connection, not a shitty mobile device running on shitty mobile network, which now make up the bulk of web browsing traffic.

>The benefit is also present only the first time you load page, because any sane browser will cache JS and CSS.
Wow.
The initial page load is the most important one, because if it takes too long your users will fuck off and go somewhere else. 53% of mobile users bounce from pages that take longer than 3 seconds to load. Plus best practices when working with HTTP/1.1 are to inline and concatenate files together and use sprite pages to use as few connections as possible, meaning if you change one little thing you have to invalidate all of your caches and download those assets again.

>Nginx doesn't support HTTP/2 fully in free version
It has for over a year.

>HTTP/1.1 already supported gzip compression
You can minify the request body in HTTP/1.1, you can't minify the headers, which are carrying around all of your web app's state in the form of long session cookies that get added to every request header.

>There are no other features worth mentioning, that would be present during normal web usage, not only extremely pathological cases.
The web is entirely pathological. The page you're looking at has done 72 HTTP requests (using HTTP/1.1, thanks Hiro), and that's not many. HTTP/1.x was designed to move simple hypertext documents around, not support web applications.

tl;dr: you have your head up your ass and people like you are why the modern web sucks.
>>
>>57572352
it is simpler to do this with background images and css:
.test {
background-image: url(some-image.png);
}
.test:hover {
background-image: url(hover-image.png);
}
>>
>>57587440
I'm !important-ing this comment.
>>
which will be more fun to get into,
client side angular 2 or server side php?

i've been using php a few months making sites already.
However angular2 looks interesting
>>
>>57596051
Do both.
>>
How the hell does this thing have Python and visual basic over Javascript?

http://www.tiobe.com/tiobe-index//
>>
Have any of you guys used Google''s Material Design guide? I get that it makes an app look really good (e.g. the Google Drive on IOS is so fucking clean) but I was thinking about using it for a desktop site (Material Design Lite)

Any thoughts on it?
>>
Is HTMLDog a good learning resource or is there a reason why it's not included in the OP list?
>>
>>57596059
what if i dont wanna into full stack?
>>
Laptop recommendations? I'm pretty due for a new one so I've been looking around.

I've heard that having a Mac is useful for easy access to all three main environments, but it seems like the Razer Stealth might be the best choice in the category with the Dell XPS coming in second. How do you feel about skipping out on macOS completely? Do you find having it something invaluable or no?
>>
>>57596170

TIOBE is the worst kind of meme. It's index gets posted all over reddit and referred to in discussions constantly. I get senior managers asking if we can pick something from high up in the TIOBE index because this indicates they'll be around longer.

It's *obvious* horseshit.

>Assembly language ahead of Ruby, Go
>COBOL and Fortran rate higher than Scala
>Clojure, Rust, Erlang all put together are still less than D
>>
>>57596208
yep its ok
>>
What do you guys think about elixir/phoenix?
>>
Good ideas for small AngularJS projects?
>>
>>57596569
Just get any laptop and install Ubuntu
>>
What is wdg's take on polymer?
>>
>>57584236
1. First of all, never assign to event listeners. Call addEventListener and removeEventListener.
2. You assign to onclick the return value of alert("ass"), which is undefined.
3. Do it like this:
document.getElementById('myButton').addEventListener('click', () => { alert("ass"); });
>>
File: aleppo.gif (583KB, 188x145px) Image search: [Google]
aleppo.gif
583KB, 188x145px
Are my eyes deceiving me, or is there nothing in the javashit standard library that allows you to remove an item from a list and returns the itemless list as its return value? It seems that everything returns the item you asked to be removed. What's the point of that? How can people say "dude JS is totally functional" when you can't even pass simple list reductions in tail calls?
>>
>>57598815
you could use filter
>>
>>57598961
far from ideal
>>
File: reprio-casper.png (71KB, 1178x452px) Image search: [Google]
reprio-casper.png
71KB, 1178x452px
>>57593125
>>And it needs manual configuration (Apache),
>You have to configure your webserver manually? How awful.
Are you supposed to be a tool or your web server?
If it needs configuration for *every* URI and resource, then yes, it's awful.

>good for UX
It's actually worse, pic related. With push enabled, browser unloads old page 150ms later –user sees it as blank white screen. It means that they don't know if their clicking had any reaction for over 2 times longer.
Your benefit is the faster by 50ms rendering of a page.
Overall, your performance is 100ms worse to act on people's reflexes.

>3 seconds
Wow, do you really can achieve page loads as long as 3 seconds? I don't know how one can fail so much.
Maybe you are one of these people who include 10 JS libraries from 3 different sources. No HTTP upgrades can save such people.

>It has for over a year.
Not in free version. Can't you read? Free version does not support server push, which you cling on to so much.
Or maybe can you point me out in which version it has been added?
Here, I will spoonfeed you with changelog. http://nginx.org/en/CHANGES

>you can't minify the headers
Which are often less that 1% of your total page load size for all request together.
>long session cookies
You know why websites serve static content from separate domain names like 4cdn.org for 4chan?

>72 HTTP requests
It had to download 70 thumbnails?! Unbelievable!
Or you want too tell me you want them to be included in the one request, extending blue part on pic related tenfold? Now we can start talking about load times calculated in seconds.

But keep pushing the goalposts.

The modern web sucks, because of people like you, who are satisfied with 5% improvements, where 500% ones are possible.
Whole computer industry sucks because of this.
>>
>>57598387
>using arrow functions in production
>>
>>57598815
>javashit
>would rather program web dev in a function language
>>
>>57599155
we charge extra for legacy browser support, so it's no problem using them in production if they don't want that.
>>
>>57599175
not purely functional like hasklel, but there's literally nothing wrong with tail calls, maps, etc. It's just how my brain is wired

It's probably because I only started working on 48hrs ago, but I'm finding myself writing more for loops and doing more direct assignment than I'd care to

it's also true that you can't do a map or forEach over document.getElementsByName? there's a lot of annoying quirks in this language
>>
File: http2.jpg (59KB, 850x481px) Image search: [Google]
http2.jpg
59KB, 850x481px
>>57599130
>If it needs configuration for *every* URI and resource, then yes, it's awful.
I think you might just be retarded. Here you go, kiddo:
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-with-http-2-support-on-ubuntu-16-04
Its not that hard.

>Wow, do you really can achieve page loads as long as 3 seconds?
Its like you've never actually used the web, at all.

>Not in free version. Can't you read? Free version does not support server push, which you cling on to so much.
Do you know what server push even is? If you did you'd understand why it doesn't matter.

It just gives you extra shit when you make a request. If you set it so it sends you the JS and CSS files along with your index html file, then of course you're going to look at a white screen while all that shit loads. Because you're retarded.

You don't need server push to get anything out of HTTP/2. Its better just to send the main index html and inline some basic styles and then go off and get resources while the user is looking at styled content. You don't need server push after the main html page has arrived because (pic related) the browser isn't going to be limited to 6 connections like it is in HTTP/1.1 and it can fetch other resources faster.

>It had to download 70 thumbnails?! Unbelievable!
Yeah, and it did them in chunks of 6 rather than doing them all at once in a stream

>Or you want too tell me you want them to be included in the one request, extending blue part on pic related tenfold?
The blue bar representing unload... what the fuck are you even measuring unload for? That event is triggered when a user tries to leave the page. You should be looking at the difference between domContentLoaded and load, and time to first render.

>The modern web sucks, because of people like you, who are satisfied with 5% improvements, where 500% ones are possible.
You're a walking example of the Dunning-Kruger effect. Anything you work on would improve 500% by you drinking bleach.
>>
File: sonic.png (1MB, 640x480px)
sonic.png
1MB, 640x480px
Why in the name of sanity is CoffeeScript still a thing?
>>
So I had to learn javascript/nodejs/ajax/SPA

Why would I make a client side app where all my precious code is open to normies when I can hide it all on a node web app? Is nodejs the future?
>>
File: 1472751058643.png (250KB, 523x372px)
1472751058643.png
250KB, 523x372px
>>57600134
>Why would I make a client side app where all my precious code is open to normies

You'd only do that if you were a literal retard, and you looked like pic related.

>Is nodejs the future?

Yes.
>>
>>57600087
Why not? I don't see a reason to use it anyway but is it harmful?
>>
File: special pleading.png (160KB, 600x680px) Image search: [Google]
special pleading.png
160KB, 600x680px
>>57599562
Here, read this.
>>57590318
>Being able to send out JS and CSS at the same time as the HTML, in a single request, is a pretty massive benefit.
And argue why, your words
>server push
>it doesn't matter
holds true.

>>>>Being able to send out JS and CSS at the same time as the HTML, in a single request, is a pretty massive benefit.
>>>And it needs manual configuration (Apache),
>>You have to configure your webserver manually? How awful.
>If it needs configuration for *every* URI and resource, then yes, it's awful.
Oh boy.
>taking about Apache, that actually has support for HTTP/2 Server Push
>he brings up tutorial for nginx, that only implements minimal HTTP/2

>Its better just to send the main index html and inline some basic styles and then go off and get resources while the user is looking at styled content
>using HTTP/1.1 optimizations that hurt performance of HTTP/2
???

>pic related
>the texas sharpshooter example

>the browser isn't going to be limited to 6 connections like it is in HTTP/1.1
Yeah, instead it's limited to 1 per origin, instead of 4-8 per origin, which is a client-side problem.

Try again, this time backing up your arguments.
You're a walking example of the Dunning-Kruger effect.
>>
>>57600309
It's gonna be replaced by ES6 (a lot of projects are already moving from CS to ES6+Babel), it simply doesn't make sense to keep using it
>>
File: gg.jpg (15KB, 719x136px) Image search: [Google]
gg.jpg
15KB, 719x136px
>>57600344
Not me, dipshit.

>taking about Apache, that actually has support for HTTP/2 Server Push
>he brings up tutorial for nginx, that only implements minimal HTTP/2
So... you're saying that because Apache is a ballache for you to configure, that means that HTTP/2.0 is bad? Maybe you should switch to NGINX? I'm sorry I don't have a logical fallacy picture to describe exactly how you're being retarded in this instance, but I'm sure you can find one in your folder.

>using HTTP/1.1 optimizations that hurt performance of HTTP/2
Let me explain again for you, because you clearly have no understanding of web development best practices.

With HTTP/1.1 you had to bundle your files into bigger files, use sprite sheets and inline the CSS in the page in order to maximize the value you got out of each of the limited HTTP connections you had available to you.

Changing any minor component of this setup required invalidating the cached versions of those bundled assets, because you had to re-bundle everything. In HTTP/2.0 you don't need to bundle assets at all, because retrieving small individual assets costs nothing, so you don't need to invalidate the caches for everything you want to send to the user, just the thing you changed.

Inlining some lightweight initial styles for the first pageload to give the user something else to look at while the browser streams everything else down from the server isn't the same thing as bundling or inlining to make the most of the handfull of HTTP connections you have in HTTP/1.1.

You'd have to be retarded to not understand the difference.

>Yeah, instead it's limited to 1 per origin, instead of 4-8 per origin, which is a client-side problem.
HTTP/1.1 has 4-8 per origin which retrieves one resource at a time
HTTP/2 has one connection which streams everything in parallel, in a non-blocking way, allowing for greater usage of the available bandwidth, resulting in faster transfer.

Please stop, you're embarrassing yourself now.
>>
File: 1478409446022.jpg (48KB, 396x385px)
1478409446022.jpg
48KB, 396x385px
so I want to be a java web developer. I know the basics of java, js, html and css. What is my pathway from here to get a job as a backend developer?
>>
Is ASP.NET webforms really outdated? Microsoft still supports 'em.

>>57600943
Web Development in Java might be on the decline, my man. I would suggest building mobile apps instead.
>>
>>57600943
https://www.youtube.com/watch?v=sBzRwzY7G-k

I dunno why you want to use Java in particular, but y'know, whatever floats your boat.
>>
>>57600993
Why is it declining? Do you have any source for that?

>>57601026
Because almost all job postings I see are either java or C#. I don't know C# so I figured it's better for me to focus on the thing I know. I can always switch later I guess.
>>
>>57600993
It's nuisance to do anything dynamic/modern with web forms.
So better ignore it, it's no good.
>>
I got a few questions. What does inline script mean? What about XHR and frame/iframe?
>>
Anyone using Angular 2? How do you find it?
>>
>>57567046
What service should I use for free private git repos?
>>
>>57601360
http://softwarerecs.stackexchange.com/q/867
>>
>>57596811
Thank you, kind not-anon.
>>
Pytanie do aktywnych polaczków. Czy pracodawcy zwracają uwagę na zdane matury? Z tego co widziałem matura z informatyki idzie bardziej w stronę C++.

Also what is better. Project Odin or just Code Academy? I already have some experience in web dev.
>>
>>57601503
Project Odin is probably the hardest but most thorough.
>>
>>57600943
Learn Spring
Everyone who uses Java should learn Spring
>>
>>57601077
I learned node.js because I thought it was neat.
All the job postings I saw were either PHP or ASP.NET
Still got a node.js job.

Just pick something you actually like.
>>
>>57601815
Will you be able to learn node.js quickly if you already know java / basic programming?
>>
>>57601931
If you only have basic programming it doesn't really matter what you learn at this point.
>>
File: 1456369833920.png (27KB, 301x266px) Image search: [Google]
1456369833920.png
27KB, 301x266px
I guess this the most appropriate thread for this question:

No matter what I do, I can't change the color of the textfield in pic related. I'm new at css, so I'm not sure what class I'm supposed to be editing, but I think I've tried all of them in the css file but none of them seem to correspond to the quick reply box's textfields. Any anons know what I'm supposed to be doing?
>>
>>57603049
I should also mention I'm using 4chanX so that might have something to do with it
>>
>>57603049
!important
>>
>>57603116
that's not it, the problem is I'm not using this dark blue color anywhere in the CSS, so I have no clue where or how it's being applied. Nothing I do seems to override it
>>
File: 1474071488035.png (12KB, 302x320px) Image search: [Google]
1474071488035.png
12KB, 302x320px
>>57603168
textarea.field {
background-color: red !important;
}


Works for me
>>
>>57603116
>>57603168
Nevermind, I finally found the fucker
>>
>>57577468

Maybe it's no use, but allow me bump this just once, I hope somebody could help me.
>>
>>57600943
I'm employed as a java back-end developer and have done full stack before, current top Java stuff is Spring with pretty much the entire ecosystem.

Spring Boot is getting popular for having the embedded tomcat
Knowing Hibernate/Spring data is good for ORM
For views you want JSP or Thymeleaf
Build tools right now tend to be Maven or Gradle, I prefer Gradle but learn both
In terms of architecture microservices are gaining ground
Learn SQL, popular databases are mysql, oracle and postgres
>>
What size laptop screen do you prefer, /wdg/?

I used to be in the 15" camp but am thinking about converting to 13" since it seems to be the new thing nowadays.
>>
>>57605837
13.3 or lower.

I prefer 11.6 but most of those are too shit to web dev with OR run ubuntu 16.04

Always google that your laptop can run it. Most have problems.

I'm currently looking at the ASUS Zenbook UX330UA-AH54

Waiting for black friday cyber monday to see if any asus zenbook goes on sale.
>>
>>57605837
went from 12.5in to 15in feels really big but I'm fine with that feeling desu.
>>
>>57605837
I use 12.1", 16:10 and it's really comfy. I wouldn't want 16:9. Not sure about 4:3 or 5:4, I guess I wouldn't mind trying out.
The only thing to care about, is to have it in some decent resolution. Don't buy into meme 1366x768 resolution, it's shit. If you can, get 1080p, or at least 1600x900. 1280x800 is fine at 12.1".
>>
It's 2016, soon to be 2017. I want to create a commerce application, I'll take orders and process them.

There needs to be a front end and a back-end. I can do that. The question then becomes:
What technology to use?
What language, what web framework?

The frontend has to rock. It needs to be snappy.
It won't process a lot of data, but if users could feel like they are using a desktop app, that'd be ideal.
It's going to be fullscreen, locked, and touch capable.



I'm leaning towards node.js, instinctively. But I loathe javascript and the thought of programming in it worries me. So what do you think, /g/?
>>
>>57606736
The only way you wouldn't know what to use is if you hadn't used anything.

ecommerce websites are one of the most advanced websites you can attempt to make and you're asking what to make it in.
>>
>>57606828
I wrote "commerce application", which means right now, something that'd only be used at a single location.

Not truly on the web (at first), but simply locally.

I have confidence in my skills, and I can adapt/learn any language I invest myself in. What I don't know, but I'm in the progress of researching, is what to make it in.
>>
>>57606880
OHHH, you mean "Point of sales" or PoS systems. Use VB. NET then.
>>
whats the most efficient way to check multiple input fields at the same time?
>>
>>57607028
Yes.

Also, why the fuck would I do that?
>>
>>57607224
jesus christ, dude. Do whatever the fuck you want then.
>>
File: result.jpg (11KB, 375x800px) Image search: [Google]
result.jpg
11KB, 375x800px
Help /wdg/, newfag webdev here, how do I append data from an API to html with ajax?
Dummy api data:
[{"id":7,"name":"adsssss","surname":"THERE I GO","bio":"Jupi","instrument":"Gitara","img":null},{"id":8,"name":"Andrija","surname":"Profesor","bio":null,"instrument":null,"img":null},{"id":9,"name":"Test","surname":"Profesor","bio":null,"instrument":null,"img":null},{"id":10,"name":"1'","surname":"2'","bio":"4'","instrument":"3'","img":null},{"id":11,"name":";-1'ada","surname":"''dasda","bio":"123'sda","instrument":"asd'2-3","img":null},{"id":12,"name":"Slika","surname":"slika","bio":"slika","instrument":"slika","img":""},{"id":13,"name":"Slika","surname":"Slikic","bio":"Slikar","instrument":"Slikovnica","img":"Slika"},{"id":14,"name":"asd","surname":"das","bio":"asdsd","instrument":"ads","img":"asd"}];

My shit code:
$.ajax({

type : 'GET',
url : 'api/v1/get_profesors.php',
success : function(result){
var data = "";
for(var i = 0; i < result.length; i++){
data += '<ul><li>'+ result[i] + '</li></ul>';
}
$('#profesori').html(data);
}
});


And the result is pic related...
>>
>>57608009
 fafsa 
\nfafsa
>>
>>57608009
You need to parse the response text to json.
JSON.parse(result)

I also have no idea what you are trying to put in the html. You have an array of a single object.
>>
I want to try playing around with node.js and was wondering what framework or full stack should I use? I've already have experience with Ruby on Rails but I'm not entirely sure if a Rails-like framework would be good with node.js.
>>
>>57608076
I've never done node.js but I thought it was a full stack framework? It does both back end and front end.
>>
>>57568617
I'm web-devving on Mint, haven't run into any issues so far
>>
>>57608793
Isn't node itself just a runtime and no more of a framework than, let's say, Ruby?
>>
>>57568617
Any of the Ubuntu flavours are good, really. I personally run Xubuntu and deploy to a Debian server.
>>
>>57608069
hmm, thanks. I've parsed this to json :

{"id":7,"name":"adsssss","surname":"THERE I GO","bio":"Jupi","instrument":"Gitara","img":null}{"id":8,"name":"Andrija","surname":"Profesor","bio":null,"instrument":null,"img":null}{"id":9,"name":"Test","surname":"Profesor","bio":null,"instrument":null,"img":null}{"id":10,"name":"1'","surname":"2'","bio":"4'","instrument":"3'","img":null}{"id":11,"name":";-1'ada","surname":"''dasda","bio":"123'sda","instrument":"asd'2-3","img":null}{"id":12,"name":"Slika","surname":"slika","bio":"slika","instrument":"slika","img":""}


So now how do I append the name and values into meaningful html?
>>
>>57609200
Loop through it.
>>
File: result2.jpg (13KB, 805x122px) Image search: [Google]
result2.jpg
13KB, 805x122px
>>57609591
I tried looping and I get the same result as I do now, pic related :(

Here's my code:

$.ajax({

type : 'GET',
url : 'api/v1/get_profesors.php',
// dataType : 'json',
// data : {
// format : json
// },
success : function(data){

// var str = JSON.stringify(result);
// var json = JSON.parse(str);
var content = 'Name : '+data.name ;
content += ' Surname : '+data.surname ;
content += ' Bio : '+data.bio ;
content += ' Instrument : '+data.instrument ;
$("#profesori").append(content);

}
});
>>
>>57583583
this is why I'm interested in Elm
>>
>>57609758
So in your success function can you console.log(data) and show the results
>>
>>57609758
Why did you commented your JSON.parse() or dataType lines?
>>
Does anyone know what would cause this weird whitespace on the right?
It's only present in Firefox, not Chrome, and only when the window size is around the same size as the content.

I'm probably missing something really obvious. The site is online at anizb dot org.
>>
>"Opinionated" fullstack framework
What the fuck does this even mean? If I actually gave a fuck about someone else's opinion I wouldn't be a fat kissless virgin right now.
>>
>>57611007
It means it generally wants you to do things a certain way. So for instance, Angular is really opinionated, doesn't mean its good or bad, just that its got a set way of doing things
>>
Dual booting or VMs? Which do you prefer, /wdg/?
>>
Flask is good
>>
Study group back up @ https://gitter.im/srs-study
>>
File: hillary1.jpg (45KB, 800x435px) Image search: [Google]
hillary1.jpg
45KB, 800x435px
Let's say i need to make a map interface that has the location and tech details of some of my work's equipment.
Now this mapping service needs to be a) free, b) preferably Desktop and Mobile friendly (more emphasis on Desktop though) and c) all the data must be local ie not on Google's server.
What are the options?
I suppose I could pull map data from OpenStreetMaps, and put on some kind of overlay, but what satisfies the above criteria, considering that we'll probably used a lot of data?
>>
File: 1362963344803.png (117KB, 1024x749px) Image search: [Google]
1362963344803.png
117KB, 1024x749px
Any freelancers here? Where do you find your work?
>>
>>57610552
<input type="submit"></input>

Use display:none, not visibility:hidden. Check MDN for how they work.
Or get rid of it completely. Or, even better, get rid of this search icon from background of text input and replace it with clickable submit button.
>>
>>57613788
That's the issue, thanks!

Only used visibility instead of display:none because for some browsers (I think it was IE) don't accept the "enter" key as a form submit without there being a submit button that isn't "display: none".

I think I'll take your advice anyway and use the submit button.
>>
>>57613737
Freelancer here. Currently I have no work, LOL.
>>
>>57614201
Haha

me neither ;_;
>>
>>57614180
You shouldn't care about IE. Especially so old versions.
>>
File: 1275368148516.jpg (35KB, 650x450px) Image search: [Google]
1275368148516.jpg
35KB, 650x450px
>>57614325
>tfw current client is society of old men
>lots of them still using IE9
>>
>want to work for myself or freelance
>cant even consider moving away from salary
>>
>>57614348
why not both?
>>
>>57614965

This.

Work part time and do some freelance on the side, it's comfy as hell.
>>
>>57615060
any tips to start freelancing?
>>
>>57613608
>sign in with github or twitter
yeah no
>>
>>57614329
I feel your pain
>>
>>57612918
If you have no experience then try linux in a vm first.
>>
>>57612918
Neither. I only use Linux.
If I had need for another OS, I would probably get another computer.
>>
Any tips on what to charge? I'm building a site for a coworker with bootstrap as the base and customizing it out for him.

Site has maybe 3-4 pages, php contact form and media embedded, flexslider etc nothing too fancy no backend whatsoever.
>>
>>57615186

Here's what I've learned from my mistakes:

1. Know your shit. If you learn stuff "on the fly", pressure will be higher.

2. Start small. My first project was too challenging. I did it, but it was hell.

3. Start where you are. If you work in a store, you can ask your coworkers if they want a site. If you do sport, ask the club (if it's small) or your training partners. Don't be annoying, just let them know. Even if they don't, maybe they have friends and will come back at you in two months, who knows. You get customers by people who like you and recommend you.

4. Have a good team / network. Beeing a lone wolf is ok for the start, but you want connections to other freelancers. If somebody wants a simple site you'll be fine, for a great layout it's better to know some graphic designers to call and join in for this project. Or if the project is bigger you might think about getting a wingman. Mind that if YOU can give someone work, the person will probably be grateful and will return the favour sooner or later. Nobody can be an expert in every area, so get to know some guys who do fancy stuff you don't know or care about.

5. Learn from more experienced people. Don't expect your competition to be enthusiastic about yet another web developer. But if you are nice and make your point (that you mean it and want to get better, not just grab some easy money on the side), people are generally friendly. Just look around until you found someone and try to build a network, but don't steal your friends customers.

6. Don't start with low prices, even as beginner. This will piss off the rest and raise wrong expectations. What you should do is to not let the customer pay for "learning time". So instead of charging 30 dollars * 70 hours rather charge 70 dollars * 30 hours. Make fair prices. For beginners I recommend fixed prices so you can grant some "beginner discount" without miscalculating too much.

7. Fake it till you make it. Some C&P is OK if you can't avoid it.
>>
>>57617200
Don't forget one of the most important pieces of advice: don't hog information. Share it. Even if just one person is regularly reading your blog/visiting your open source projects, you're at least making the world much better.
In turn, fresher developers will look at you as if you're much more knowledgeable than they are. Continuing the cycle of learning from more experienced people.
>>
>>57617200

> charging 30 dollars * 70 hours rather charge 70 dollars * 30 hours

Of course that are more or less arbitrary numbers. It all depends on where you live, your costs, your skill level and especially your customer. Of course you a company will be able to pay more that some friend of a friend of yours. A high-class website where you create content (i.e. searching for pictures) is more expensive then some jumbotron one-pager. A message board is way more work than an image gallery. And so on.

It's important to really make a calculation of your costs, how much money do you need per month? Nobody gets along perfectly fine in the beginning, but don't be too cheap, you will regret it.

As I said before, as beginenr you will need learning time. Which means a website that will take you 60 hours now will take you about 30 hours in the future. Again I advise to not lower the price per hour, but rather work a few hours "free of charge", but don't let the customer know this, it's not his business.

Always try to be professional. Don't leave your customer haning, call him often and early, even if the news are bad. Even if you fuck up one project, it's not the end of the world. Even if you lose a customer it's not the end of the world. Just be professional, some cutomers can be nasty if they sense weakness.

ALWAYS make sure both of you have the same undersatnding of what you are going to do. How many designs are going to propose? If you made three good designs and they are still not satisfied, either charge extra money or leave the project (of course you can make a differnt deal, but 3 is a good number). How many times you are going to fix and/or redesign the site? Draw a line from the very start. A lot of people don't talk about such things and then either keep on changing the website for half a year without payment or the customers gets pissed of. Avoid this by writing things down, everything is negotiationable, but be sure to talk about it with the customer.
>>
>>57617328

Right, this.
>>
I always feel a loser when I have to ask a question here, but whatever.

There are lots of CSS frameworks out there, but all of them use very specific classes and etc for formatting, and when you are programatically generating a page, your code becomes framework-dependent.

Is there any framework that let you compile the CSS to adapt to your page (in a way defined by you, of course), instead of the opposite?
>>
>>57617200
Oh and another would be getting used to licenses. http://choosealicense.com/
Helps a lot, but remember to actually read the licenses you're going to apply to your projects.
I know a guy who just open sourced his project he spent years on, used the wrong license, and there was somebody who used his exact open source project, uploaded it to the play store with a slightly different name/branding, and that person got way more users (and money iirc).
This isn't to scare people away from open source, rather it's to get people to understand licenses rather than just copying shit and thinking you're protected.
>>
>>57617448

Wat?
>>
>>57617512
For example, you say to style a button in mdl with class="mdl-button". If you are generating this button from code, that means your code is dependent on mdl now.

But if we could just say class="my-button" and tell the CSS generator that "my-button" is to be treated as "mdl-button" and adapt the code for it.
>>
>>57617200
>>57617404
thanks for replying! what is the best way to calculate how much time on average its going to take to finish a project? Using your example, I might take 70 hours to develop something but on average people would take 30 so I should charge based on that, but how do I get on that number?

This is really important so I don't charge way less or more than what I should and what other developers would ask, I want to be fair to the customer and to the time that I spend developing.
>>
how do i connect to a SQLite database (.db file) in php so i can read/write from the tables in it? all i have is the db file and i have php running on the local server. Just working locally for now.
>>
>>57617570
https://secure.php.net/manual/en/sqlite3.query.php#example-2388
>>
>>57617554

Well, this is one of the most difficult topics for pragrammers. It's mostly experience and good analysis of requirements.

As beginner you could use agile methodology, write user stories / backlogs and try to make an estimation for every tickets (story points). You can later adjust how much time you thought you would need and how much time you really needed. This way you will get better with every project.


There's no chance your first few estimations will be anything but miscalculations. Just get over it, you have to invest to get something out of it. Just make sure you learn from your mistakes.

This ia also a reason why you should start with small projects, if you calculated 20 hours but worked 25, it's no big deal. Maybe the customer will even pay for the 5 hours if have good reasons. But if you calculated 200 hours but worked 250, that is a big deal.


>>57617570

Took me 5 seconds to google it, you idiot:

$dir = 'sqlite:/[YOUR-PATH]/combadd.sqlite';
$dbh = new PDO($dir) or die("cannot open the database");
$query = "SELECT * FROM combo_calcs WHERE options='easy'";
foreach ($dbh->query($query) as $row)
{
echo $row[0];
}
>>
>>57617665

does the line

$db = new SQLite3('mysqlitedb.db');


create a new db? i already have one created. Confused on that part
>>
>>57617822
https://secure.php.net/manual/en/sqlite3.construct.php
>>
>>57617800

i actually tried that first and it didnt work but i just realized i was dun goofing the path to the db file. Works now.
>>
>>57617880

Good.
Just use google next time and don't flood the /wdg/ with stuff like that.
>>
>>57617915

how do i hello world in javascript?
>>
>>57618033
Well, I would suggest learning jQuery, React and maybe a few other frameworks. Also don't forget to use Bootstrap.
>>
Anyone doing/done the Odin project? I got up to the Rails section, and then I got burnt out because of programming for school. Should I finish this bitch out?
>>
i'm using this code to grab the latest entry in a column

$queryReplacementNum = "SELECT [Replacement-#] FROM ReplacementOrders ORDER BY [Replacement-#] DESC LIMIT 1;";
foreach ($dbh->query($queryReplacementNum) as $row)
{
$replacementNum = $row[0];
}


then i just use the $replacementNum variable wherever i want the data. However there are other latest entries i want to use. Do I have to make a query variable and foreach loop for each piece of data i wanna grab?
>>
>>57618792
I was thinking of starting it how has it been for whatever else you've done?
Thread posts: 327
Thread images: 38


[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.