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

>Discord https://discord.gg/wdg >IRC Channel #/g/wdg

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: 328
Thread images: 31

File: 1490643143606[1].png (874KB, 824x553px) Image search: [Google]
1490643143606[1].png
874KB, 824x553px
>Discord
https://discord.gg/wdg

>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.wikipedia.org/wiki/Comparison_of_web_application_frameworks
[Gist] backendDevelopmentBookmarks.md

>Useful tools
https://pastebin.com/q5nB1Npt/ (embed)
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/ (embed)

>How to get started
http://pastebin.com/pDT82mQS (embed)
http://pastebin.com/AL6j7GEE (embed)

>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
>>
>>59634728
I got a new problem for you people.

When I press back after logging in, my browser loads the login form from its cache. How do I stop that?

My current solution is to set the Cache-Control response header to "no-store" when I serve the page, but I am not happy with that.

Supposedly, before the browser loads a page from the cache, it asks the server if the page is still valid. If not, it downloads the page from the server rather than loading it from the cache. So, how do I add custom checks to that server side validation? I am using Node and Express.
>>
Where can I browse well made webpages? Right now I just CTRL + S what I like, then scroll it.

But I would like to study the anatomy of web projects. Is there a github storehouse for web page projects somewhere?
>>
Which is the best for frontend and why?
- angular
- react
- vuejs
- ember

Which is the best for backend and why?
- rails
- django
- laravel
- sailsjs
- spring

Which is the best for mobile and why?
- react-native
- cordova
- xamarin
>>
What is everyone's view on stuff like Jekyll or Hugo, do employers tend to look for experience in them.
>>
>>59635072
employers don't give a fuck about static site generators
>>
>>59634987
react - easy find job, works fast, easy to learn.
>backend
golang (go) - performance, easy to develop.
>mobile
plain ES7, css4,html6.
>>
>>59635176
bait
>>
I know of simple preprocessors for basic front end like Sass/less and Jade/Pug, but they seem so inefficient how do people "merge" them all together so developing is quick and seamless.

That is an awfully worded question I am sorry, but I don't know how to make using multiple preprocessors a clusterfuck.
>>
>>59635236
they're all shitty old technologies. Get with the times and use React with PostCSS senpai.
>>
Simple question.
Let's say you're making a mobile app (Android). Are you supposed to make it like you would be making a website but instead you change the display and a bunch of stuff or is it a whole different way of doing things ?
>>
>>59634987
If there was a best one, everybody will use it.
It's not the case. All have their own strength and weakness. It would be too long to explain each. There are multiple articles around, just do some research.
>>
>>59635266

Oh my god why do they keep adding shit every fucking month
>>
>>59634987

The differnt frameworks in one category are pretty similar..
If you're great with React, you'll understand Agnular2 fast.
If you're great with Rails, you'll pick up Laravel or Django fast.

So it's more a matter of what langauges you know, /like or what your team/company uses.

Also there are always trade-offs. I.e. Golang is nice for small servers, but you don't have that many libraries as i.e. Rails and you produce a lot of boilerplate code. Rails is fun to code, but not that fast and deployment is a little bit bothersome. PHP is faster and has super eaasy deployment, but the language itself is cumbersome and there are not so many good frameworks.. and so on.


You can't have everything at the same time. Just start somewhere and work with things you like.
>>
>>59635268
It depends on what you want. You can make it like you would a website and wrap it in phone gap and cordova, or you can make it native. Native will be faster, but phone gap allows you to port it over to iOS and to the overall internet (as a website)
>>
>>59634987
You forgot jquery movile, mobile angular ui, and titanium.
>>
I wish all those backend rockstar superstars in my team fucked off from my frontend. Somehow the html is so easy and below them yet all they do is always mess it up.
>>
What is your guys opinion about using stuff like { condtion ? <div></div> : <div></div>} in react render instead of putting all this code in separate functions that are placed 100 lines below somewhere in file.
>>
>>59636688
Called a ternary operator. If that's the only place that that condition is used AND the outcomes are simple, I'd use them inline like that. Otherwise I'd extract them out
>>
>>59636734
I use them like that too, but the people at my job behave like those are some kind of insults to their religion and families.
>>
>>59635236
You can have a task runner perform one compilation then another.
>>
>>59636754
I get the same thing from some coworkers. But unless there's a standard set that all logic must be in the controller, those rules are reasonable. Maybe they want all logic in the controller, I'd be fine with that too. Just so long as there's a reason things are the way they are
>>
>>59636776
There is barely any standard. They would put it into dozens of render functions and spread it all around file without any logic.
>>
>>59636607
100% yes. They have no idea what the fuck they're doing on the front so they should stay the fuck out. Especially when they try getting into design. Nightmares.
>>
>>59636607
Try to find the best way to talk about this to your project manager or team.
>>
>>59636828
I'm not entirely familiar with how react files are laid out. You'll have to give me more detail to understand
>>
>>59636883
They would just put this into renderCondtion() { if condtion ( return <div></div> } else { return <div></div> } }. Those would be put all around file without any logic.

I find having a lot small functions like that just breaks the flow when you have to jump all around file.
>>
>>59636858
Especially when they only work on chrome and it looks ok for them. But you have also need that site to display correctly on your boss moms 10 year old electrical oven display.
>>
>>59637101
Yep. It's just annoying, I don't waltz on over to the backend and start fucking around. Why do they think they can do it to me? They act grand all the time about how the front end is worthless and yet the concept of media queries just don't exist for them.
>>
>>59634987
>Which is the best for frontend and why?
vuejs

Easy to learn. Good docs. Everything is in the docs.
No need to search stackoverflow for questions. The vuejs author is a former angular/react user so he knows what's good. Easy to remember syntax well. Shorter code. Its up to you if you would like a simple "central state" or a full-blown VuexStateManager like in redux

>>59637005
vuejs version:

<div v-if="!loading></div>
<div v-else></div>

:^)
>>
>>59637194
>he isn't getting paid for vue shilling
exploit anon
>>
File: hqdefault.jpg (52KB, 480x360px) Image search: [Google]
hqdefault.jpg
52KB, 480x360px
I need advices.
I'm currently working on a web app with a Javascript framework (Vue.js) and Spring.
And I'm struggling too hard on fixing every error I meet.
When I have to write a method in Spring for a repository or anything, I'm doing fine.
But as soon as I have to make an http request to pass some info from the Javascript to Java, I fuck up.
Any advices or tutorials that'll help me with this. I learned Javascript on the spot without a proper theory so that might come from that but I don't know, it doesn't seem to be really complicated in the first place.
>>
Trying to swap stylesheets using a button on my website but I have no idea why it isn't working, can anyone help?

HTML FILE, SCRIPT AND LINK ARE IN HEAD, LIST IN BODY
<link id="pagestyling" href="style.css" rel="stylesheet" type="text/css">
<script src="script.js"></script>
<li><a class="navbar-right-items text-center" onclick="SwapStylesheet()"><i class="fa fa-moon-o" aria-hidden="true"></i></a></li>

JS FILE
function SwapStylesheet() {
var currentSheet = document.getElementById("pagestyling").href;
var newSheet;

if (currentSheet == "style.css") {
newSheet = "styleDark.css";
}
else {
newSheet = "style.css";
};

document.getElementById("pagestyling").setAttribute("href", newSheet);
}
>>
>>59637669
http://stackoverflow.com/questions/19844545/replacing-css-file-on-the-fly-and-apply-the-new-style-to-the-page
>>
Why is safari so shit. If something wont render properly it's always in safari. I feel like I'm back in ie6 sometimes.
>>
>>59637513
>And I'm struggling too hard on fixing every error I meet.
>it doesn't seem to be really complicated in the first place.

>>59638255
Safari is the new IE. Especially if you count iphones.
>>
Where the fuck can I learn about Javascript?

Literally every video tutorial and book has outdated information and the code does not work anymore.

>got a $200 Udemy course for free on web development
>guy does CSS on the html files, tells everyone about external stylesheets on the last video of that section
>Javascript time
>literally just create a button and an alert
>it doesn't fucking work
>>
>>59638678
Javascript doesn't change that dramatically that code just suddenly stops working. Unless the content produced in the first place was some random ass youtube videos.

Just torrent some pluralsight shit m8
>>
>>59637513
So send http requests from front to back end using ajax or whatever

In spring make sure you have spring mvc jar loaded by your project management system (maven or graddle) or relevant spring boot starter if you use spring boot
Define a controller class with @Controller or @RestController annotation, make functions that handle http calls you are gonig to make with annotations to define parameters, http path, http methods and whatnot. Call your services in these methods, make them either return a view name if you use a templating engine or just some object that should get serialized to json. You'll need to define more or less config depending on if you use spring boot. Just look shit up on stack overflow, any spring tutorials or spring's official tutorials and docs
example controller
@Controller
public class Controller{
@RequestMapping(method = RequestMethod.PATCH, value = "session")
public ActivitySession patchSession(@RequestBody ActivitySession session){
session = sessionService.doWhatever(session);
return session;
}
}
>>
>>59638678
http://eloquentjavascript.net/
>>
lets say i have an orders table and each order can have multiple items. User clicks the "add item" and inputs that items info, but then they add another item. How do i save that item in the table? if i create another input form for it and click save, how will it know to save just that item? How do i seperate the items? the first item input has some unique id's but they wont be unique anymore once a user adds another item, thus screwing up my back end code for grabbing that form data. Hopefully im explaining this clear...confusing as fuck.
>>
File: qSXj3Xl0qmQ.jpg (125KB, 721x1080px) Image search: [Google]
qSXj3Xl0qmQ.jpg
125KB, 721x1080px
>>59638746
dropwizard or spring boot for rest
>>
>>59638922
one to many relationship between user and order, one to many relationship between order and item
order starts out as not validated by user, then gets user validated (ie user clicked "order" button and isued payment), order then gets processed, shipped or whatever
you can now return unvalidated order when user browses the site so he can add items before validating it, with some kind of shopping cart interface. you can update order in database each time user adds or removes items to it, until user validates order
>>
>>59639127

this is just an internal app i dont need validation or shopping cart software, etc. Lets say users adds 2 items. Fills out the info for them. Hits save. How do i have those 2 items get put in the orderItems table? i know how to do it with one item. But more than 1 item is confusing me. How do i give it different id's and names so its saved properly? everything needs to be separated and its confusing the fuk out of me my brain cant comprehend it. The first item im grabbing the data using the forms id, but if they were to add another item would all the id's need to be generated on the spot? and when i click save how will it know to save both items? this is crazy as fuck....
>>
Attempting to use this in javascript file to swap an icon. Can anyone see any issues with it? The rest of the code in my if statement works.

document.getElementById('stylesheetButton').className = "fa fa-moon-o";
>>
>>59639278
Ignore this, I'm an idiot and didn't give the icon the id
>>
>>59639221
store order with its own id and an array of foreign keys corresponding to this order's items ids. you pobably need a user id field as well
update the item id array each time you add or remove items
you access all this by querying orders with corresponding user's id or just have an array of order ids as attribute to each user, get the item id array, fetch each item from db using thoses ids
you might need a way to differenciate current orders that can still be modified to past orders, that's why i suggested you maintain a state attribute on each order to keep track of which order can still be updated
>>
Updated and fixed some stuff on my paint site:

http://alissa.ninja/paint/
>>
>>59640096
What does the english/japanese button do?
>>
>>59640267
It's Korean. It changes the buttons into Korean
>>
>>59640096
You some kind of koreaboo?
>>
How the hell do I create a handlebars template inside a handlebars view?
I have an index.hbs-file in which I want to create an inline template like
<script id="button_row_template" type="text/x-handlebars-template">
<div class="row">
{{rowText}}
</div>
</script>


But since it is in a handlebars view it tries to set {{rowText}} when the view loads thus not printing out {{rowText}} at all. Am I doing this the wrong way?
>>
can being a webdev be comfy or is it always high stress?
>>
>>59640623
use three braces like {{{rowText}}}
>>
>>59640704
I'm comfy.. real comfy.
>>
>>59640711
Sadly it doesn't work
>>
>>59640623
>>59640770
what are you even trying to do?
this seems like the complete wrong approach, why not use partials?
>>
>>59640794
I want to have a template in the view in script tags that I can use in the front end javascript to create elements.
I guess I'm not thinking about this the right way.

Making a partial of the template didn't work either as it still removes {{rowText}} from the inner html of the script tag.
>>
>>59640794
>>59641080
...as in this example:
https://stackoverflow.com/questions/13874161/is-there-a-way-to-ignore-handlebars-templates-within-a-handlebars-template
>>
File: 1481655701.kaifineart.jpg (377KB, 1234x1600px) Image search: [Google]
1481655701.kaifineart.jpg
377KB, 1234x1600px
>>59640414
Yes oppa
>>
>>59641092
It worked to escape the tags, like \{{rowText}}
>>
which is easier to make mobile first or desktop first design? and which resolution is the minimum to start for mobile design?
>>
>>59641281
Desktop first isn't a design philosophy and never was. Mobile first is though.

Mobile first means your base css is for mobile devices and media queries are for larger resolutions. Just use Firefox/Chrome's responsive tool to test the design.
>>
>>59641281
What is the project? What stack is being used?
>>
>>59641281
You can make both at once.

Instead of

@media only screen and (max-width: 600px){
#foo{
width: 100%;
padding: 1px;
}
}
@media only screen and (min-device-width: 601px){
#foo{
width: 8in;
}
}


simply do like:

#foo{
width: calc(100% - 10px);
max-width: 8in;
}


Design your site so that the same CSS rules make a good, responsive site, regardless of screen width or aspect ratio
>>
>>59641390
>wasting resources for no good reason
web dev was a huge mistake
>>
>>59641349
>>59641365

it seems like a pain to design it first for mobile, I display big tables of data and they look awful when they get resized for mobile since you have to scroll over each column independently
>>
i have some forms in a div and trying to do this

#rightSide form:nth-child(even) {background: #fff;}
#rightSide form:nth-child(odd) {background: #f2f2f2}


not working tho. Any ideas?
>>
>>59641552
Ideally you remove columns as you scale down to mobile, keeping only the most important
>>
>>59641599
your probably fucked up the markup part.
post it.
https://codepen.io/anon/pen/QpJEdm
>>
>>59641552
Actually it's not that much of a pain even when displaying a lot of data. It's a good way to trim down on irrelevant data to mobile users, in addition to this you should be designing vertically when it comes to mobile. Again, not all that difficult even when you add in a query for mobile devices being held in landscape.

Much easier to scale up than it is to scale down. So next time when you're even designing 'big tables' start with your mobile design of them (hence mobile first...) and then expand the fuck out of them for larger screen users. So many great examples of ways to go about this too, like on mobile devices you can lock the first column, or you can set rows to expand on tap, etcetcetc. Whatever, get creative.
>>
Are HTML image maps verboten and replaced by some javascript nightmare or are they still totally acceptable?

(I don't have any real use for them right now, but it occurred to me it could be a fun and relatively simplistic way of hiding easter eggs in a personal site.)
>>
>>59641708

ok its kinda wokring now...except its treating 2 like an odd number....i only have 3 forms.
>>
>>59641779
Image maps as in tilesets for icons and stuff? Most people use fonts since they scale properly for high DPI, or SVG.
>>
>>59641785

nevermind i got it. I had to do it this way

#rightSide form:nth-of-type(odd) {background: red;}
#rightSide form:nth-of-type(even) {background: green}


weird.
>>
>>59641535
wut
>>
So have any of you actually gotten a web dev job in a reasonable amount of time (under 6 months) from teaching yourself from scratch?
>>
>>59642137

im sure its happened. Probably not a good job tho. The real shit is full stack development. A sturdy year of studying that could get you in with teh big boys
>>
whats the best way to rewrite this piece of shit code?

switch (data["taken_by"])
{
case "bob":
document.getElementById("taken_by").value = data["taken_by"];
break;
case "john":
document.getElementById("taken_by").value = data["taken_by"];
break;
case "phil":
document.getElementById("taken_by").value = data["taken_by"];
break;
case "joe":
document.getElementById("taken_by").value = data["taken_by"];
break;
case "sean":
document.getElementById("taken_by").value = data["taken_by"];
break;
case "clark":
document.getElementById("taken_by").value = data["taken_by"];
break;
case "jake":
document.getElementById("taken_by").value = data["taken_by"];
break;
default:
document.getElementById("taken_by").value = "john";
}
>>
>>59642294
stop calling the dom so often, make a variable with the call to the element and use that reference to modify .value
>>
>>59642137
>reasonable amount of time
> (under 6 months)
cant stop laughing
> from teaching yourself from scratch?
omg it gets worse lmao
>>
>>59642294
const validNames = ['bob', 'john', 'phil', 'joe', 'sean', 'clark', 'jake'];

let name = data['taken_by'];
if (!validNames.includes(name) {
name = 'john';
}

document.getElementById('taken_by').value = name;
>>
>>59642423
missed a closing ) for the if, but you get the idea.
>>
>>59642402
>cant stop laughing
I actually got a full stack job in a little under 3 months, but I was practicing at least 8 hours a day.
>>
>>59642540
What's the workload like? I'm also studying pretty hard but I have no clue when to stop and when to start looking for a job
>>
>>59642540
I got a part time full stack job 1 month into transferring from community college to 4 year school, as well as a summer internship
>>
>>59642570
Once I got my second project done for my portfolio I started applying. Only got $50k starting, but that was more than I was expecting since I live in a very low cost of living city.
>>
>>59642540
School?
>>
>>59642762
>School?
No, self taught.
>>
>>59642781
No I mean what did your education look like, high school? College dropout? Grad in diff industry?
>>
>>59642807
Community college dropout. I was pissed since I could have taught myself the entire first CS course I took in like 30 minutes. I just stopped going to all my classes like 3 weeks before the semester was over and started teaching myself.
>>
>>59642952
Same, but I'm finishing my degree
>>
>>59642952
First sem dropout? Not bad in that case, good on you anon. Saved yourself some tuition money at least lmao
>>
>>59642982
>First sem dropout? Not bad in that case, good on you anon. Saved yourself some tuition money at least lmao
Yeah, first sem. And since tuition was only $2500 a semester anyways I'm not in any debt since the pell grant covered it all.
>>
Say you are starting a static website, what process do you go through?

At the moment I am just doing it analogue, making the folders and shit, but I feel like there must be a better way seeing how so many people need to do 90% of the same shit.
>>
>>59643096
Depends what tools you use. There definitely are tools that do majority of that for you automatically.
>>
>>59642137
>So have any of you actually gotten a web dev job in a reasonable amount of time (under 6 months) from teaching yourself from scratch?
If you look at the bootcamp curricula, the amount of hours you spend working is anywhere from 600-800 in a 3 month span. If you're top tier you can get a job about a month after graduation. So if you can hit that 800 hours of work in 6 months, I think it's feasible to get a job.
>>
Has anyone used pug?

All the material and support is for Jade which became pug, does anyone know good compilers for Pug?

Does Koala work?
>>
File: 1423539428281.jpg (156KB, 803x688px) Image search: [Google]
1423539428281.jpg
156KB, 803x688px
>get a bachelors degree in communication technology
>uni focused on PHP because "most jobs rely on modifying existing shit and php used to be everywhere"
>only touch on JS for half a semester (they had more optional JS classes that no one told me to take)
>many jobs around me but they all want JS people
>php and mysql jobs all need JS experience too
>try to teach myself JS but I am just too stupid to understand any of it


well shit
>>
Huh, if I go to work coffee free I get to come home not mentally exhausted.

When I drink coffee in the morning at work I am so mentally exhausted it's hard to drive.
>>
>>59644712
>try to teach myself JS but I am just too stupid to understand any of it
if you're too stupid to understand JS, programming just isn't for you.

>>59645082
i didn't sub to this rss feed pls delete
>>
File: wtfisthisshit.png (90KB, 672x1048px) Image search: [Google]
wtfisthisshit.png
90KB, 672x1048px
>>59645116
have you seen modern js? it's made by retards and for retards. fucking callbacks everywhere built on top of faggy frameworks
>>
>>59644712

Work yourself through "Eloquent JavaScript" and you're good to go (at least for entry level).
>>
>>59645205
i thought we were using promises nao
>>
>>59645205
>it's made by retards
therefore you should have no problem understanding it but here you are struggling... so what does that say about you?
>>
>>59642294

switch (data["taken_by"]) {
case "bob":
case "john":
case "phil":
case "joe":
case "sean":
case "clark":
case "jake":
document.getElementById("taken_by").value = data["taken_by"];
break;
default:
document.getElementById("taken_by").value = "john";
}
>>
>>59645116
>i didn't sub to this rss feed pls delete
It's a tip in the even other people experience it at a web dev job.

No one cares that you don't have a web dev job, this is a web dev thread. Go unsubscribe from life, pleb.
>>
>>59645263
Where would you suggest to go after going through it? Just pick a framework and go nuts?
>>
>>59645311
So according to your brainlet logic, retarded code written by monkeys is more readable because they are retarded? Makes sense.
>>59645310
i don't know it, but its just looks like shit
>>
>>59646087
>So according to your brainlet logic, retarded code written by monkeys is more readable because they are retarded?
You really jumped through that many mental hoops just to try and make yourself come out on top instead of just admitting "hey, I don't know anything about javascript because I'm struggling with it". Although I suppose it's rational one lashes out at strangers when they themselves feel frustrated.
>>
>>59645567
It's not really a good tip though because not everybody has the same reaction to coffee that you do. No one cares about your abysmal tips that really only concern you. Perhaps post about something more interesting like what you're currently working on, problems you're having, and so on.

wdg sure is the angsty
>>
File: c5e28fd1c8fa5d2af3.png (313KB, 456x343px) Image search: [Google]
c5e28fd1c8fa5d2af3.png
313KB, 456x343px
>that one guy who uses 'Monokai'
>>
I can't get padding to apply to this image or the text? The text is almost flush with the image and I am trying to pad it away, to no avail. https://pastebin.com/y19ZrnZ0
>>
File: pad.png (13KB, 519x744px) Image search: [Google]
pad.png
13KB, 519x744px
>>59647718
your padding seems to be working fine my man
>>
>2017
>still using flash
why is this allowed?
>>
>>59648102
isn't it disabled by default on modern browsers?
>>
>>59648062
No, the text is to the right of it and is ending up basically flush with the image. I cannot seem to get any padding between the image and the text.
>>
File: 1320987271193.jpg (52KB, 445x500px) Image search: [Google]
1320987271193.jpg
52KB, 445x500px
I want to design and run my own chan site
What language is good for that and how do I learn to be a webmaster?
>>
>>59648278
You are missing a lot of </div> tags, try counting your <div>s and ensuring they have appropriate closures
>>
>>59648366
3 for 3.
Problem was literally just a stray bracket.
>>
>>59644712
Check out funfunfunction. I watched 3 of his vids while on the elliptical last night and I now know how to use filter, reject, map, and reduce. Pretty dank
>>
>>59649055
that triggers me, your pastebin's goofed compared to what you were looking at then
>>
Jesus christ, anyone want to get transported back into the 90s?
https://www.mylanguageexchange.com/Default.asp
>>
>>59649176
Oh, the pastebin is missing one. Oop.
>>
File: QNrPj.png (163KB, 1151x688px) Image search: [Google]
QNrPj.png
163KB, 1151x688px
REQUESTING HELP. I've used selenium a number of times to successfully write web scrapers but right now I'm struggling to scrape some data that's loaded dynamically on airbnb.

on airbnb.com when you look at a property listing, you can click the check-in box which brings up a date-picker. It shows which dates are available for that property and if you hover over a date it shows you the price for that night. I'm looking to scrape this calendar data: so for each date of the month, is it available and what is the price?

However, the date picker and its data are loaded dynamically and I cannot seem to find it in the source using firebug. When the date-picker is displayed clicking on firebug's highlight-inspector makes the date-picker disappear.

Attached picture shows the date picker. In firebug you can see the input element which toggles the date-picker to be displayed.

how/where can i find the html that displays the date-picker so I can search for it with selenium?
>>
So I have a bunch of sites I want to make.

1 - A better foreign bride website.

The current ones are shit and outdated as well as too expensive. Seriously, $895 for a week.

Anyone want to work on it with me?
>>
>>59649616
shit is literally run by criminals man, you'd need connections for brides, and a way to avoid being murdered by existing operators.
>>
>>59649638
They get to sign on their own free will. These bride services aren't trafficking operations, that doesn't make sense. They want to come to the USA or EU. I'm looking at an 18 year old that's 4'11" and 86lbs looking for an American husband.
>>
>>59649678
just because girls sign on because they want to doesn't mean it isn't run by criminals. Literally organized crime owns these websites.
>>
>>59649428
The element you are looking for is populated at the bottom of the html page when you pick it, it goes by

>div.ui-datepicker.ui-widget.ui-widget-content.ui-helper-clearfix.ui-corner-all

slap display:block on it and you should be able to figure out the rest without it going away
>>
>>59649704
That doesn't make sense.
I'm not a criminal and I'm expressing interest in operating a site in the field. What exactly makes it criminal even though it's not illegal?
>>
>>59649704
We're all waiting for your motherjones, xojane, or huffpo source on those claims.
>>
>>59649742
it's not criminal, I'm just saying, all your competition is run by criminal organizations, as in, local mobsters run sites for their region/country/city. They profit directly from the subscriptions/finders fee/processing fees those sites charge.

So you are competing with actual criminals.

Another downside is that if you don't speak the language you are going to have trouble getting anyone to sign up.
>>
I hire two translators for 1 hours each. Once to translate the homepage and once to verify the accuracy.
>>
>>59649616
Keep your honor, anon or >>>/r9k/
>>
I'm gonna go through my code and replace most relative paths with absolute paths.

However, all my absolute paths start with localhost:/website-title/

Will "http://website-title.com/~" work in my code? Or do I just put "localhost:/website-title/" until I get a domain?
>>
>>59649740
thank you anon!
>>
>>59651316
why would you replace relative with absolute paths?
>>
>>59649616

Go for it mate, I wish I was at a level that I could help, but I am not really.

Still think there are so many Internet only businesses like that, which have antiquated websites. Make the best one, and you are in-line for a big payday.
>>
What is your web browser of choice for web development, and why?
Firefox: comes with out of the box good inspect element tools, debugging never was easier.
Issues: Scripts sometimes lags when i run them.
>>
Why is it that when I move a div containing some Javascript, the Javascript element just disappears entirely?
>>
I got my DNS A record pointing to my server's public IP rather than it's private IP. Is this right? I can't actually serve my site using the public IP but I can with the private IP (if not using 0.0.0.0). The public IP is used for SSH but using hostname -I displays the private IP.

I set the records up a while ago and forgot about them. Should I change it to the private IP? Bit confused.
>>
File: Adobe_Dreamweaver_CS6_Icon.png (36KB, 256x256px) Image search: [Google]
Adobe_Dreamweaver_CS6_Icon.png
36KB, 256x256px
What do you guys think of Dreamweaver?
>>
Would you guys rather extend an (existing) Rails site with some features or do a complete rewrite with something like Node/React?

Is it worth getting into the code base? The site is not that small, it would take some time. But I'm not sure about Rails..
>>
>>59653930
Bloated and old, it was fine 10 years ago. It has many features, but Adobe doesn't develop it any further. Looks like abandonware sold for a full price.
>>
>>59653695
Post public and private IP, because
> I can't actually serve my site using the public IP but I can with the private IP (if not using 0.0.0.0)
Not quite sure what you mean.
>>
>>59654028
It's a scaleway VPS. As in, if I specify the host when serving the website, it works with the private IP (10.5.154.199), but not the reserved public IP (177.160.134.242) address.

https://www.scaleway.com/docs/deal-with-private-reserved-ips/
>>
>>59653695
The reason DNS records exist is so that you don't have to remember the public IP addresses of public services.

A private address is limited to only the local network of that physical host meaning that anyone outside the local network won't be able to connect to that private IP.

The reason why the host only shows its private IP is likely because it's behind a router that is assigned the external address. The router would then be configured to port forward requests like SSH and HTTP to local server hosts on your network all through the same external IP.
>>
>be fronted dev
>estimate task at 8h
>"wah, too long"
>task goes to backend dev that estimated it at 3h
>he finished in 20
>it only looks good in chrome
every time
>>
File: pic.png (6KB, 623x107px) Image search: [Google]
pic.png
6KB, 623x107px
Anyone has an idea how to achieve something like pic in CSS?
>>
>>59654158
#parallelogram {     
width: 150px;
height: 100px;
-webkit-transform: skew(20deg);
-moz-transform: skew(20deg);
-o-transform: skew(20deg);
background: black;
}
>>
>>59653695
> hostname -I displays the private IP
It's OK. Your VM is just a container with a private IP, public IP is attached to it through some middleware.
> I got my DNS A record pointing to my server's public IP
Yes, that's how it should work.
Chech if you can get anything through a telnet (telnet localhost 80 on a VM, telnet <public IP> 80 from the outside).
>>
>>59654112
telnet 177.160.134.242 80
Trying 177.160.134.242...
telnet: Unable to connect to remote host: Connection refused

Either you have a firewall there, or web server is not running. netstat -plnt | grep 80.
>>
>>59654139
we need a hitler for backend devs 2bh
>>
>>59654139
why would the task go to a backend dev anyway, the opinions and estimates of the frontend dev should be respected within their remit

they should have more relevent things to be doing related to their own abilities desu

management init senpai
>>
I have been assigned the task of constructing a web page for a small business.

Looking for advice for what systems, frameworks, methods to use.


Any suggestions greatly appreciated.
>>
File: chart4a.jpg (24KB, 618x297px) Image search: [Google]
chart4a.jpg
24KB, 618x297px
>>59654848

1. vuejs for the "View"
2. central json "Storage"
3. individual modules for routing, controller events
4. mediator js pattern for loose coupling(important!)
>>
>>59654848
Joomla or Wordpress can save you some time, don't try to reinvent the wheel, find a nice template and adjust it for your needs
>>
>>59655277
Thanks. I will go with Wordpress -- this is my first project! Any further suggestions greatly appreciated!
>>
So what's the best "I'm a lazy shit that just wants to make A CRUD app with minimal effort" solution?

So far my research makes it look like krakenjs and reactjs with whatever orm is a pretty good solution.
>>
I got a question.
I have a css file and with some stuff that I refer to my file but my file won't pick it up. If I try a css from the net and apply it works. So I just tried with a simple copy paste one part of the stuff with same naming and it "works" but as soon I change both places it fucks over and doesn't apply. What gives?
>>
>>59656665
i don't understand the question

your pathing to your css file is broken? your page cannot load the css file on your server? learn directories/pathing. Maybe you're missing the preceeding / in your <link href="/public/css/stylez.css">

or you're writing seemingly valid css that isn't showing? inspect element in your favourite browser and see if the rule for that property is being dominated by another source. throw in some !important or something for luck.
>>
What do you think of my imageboard design?
>>
>>59656968
C'est simple et clair, j'aime bien les couleurs aussi. Mais j'aime pas que les messages n'ont pas la même taille. Tu bosses avec quelle techno ?
>>
>>59657028
Le serveur est en Python simple sans framework (aiohttp). Pour la base de donnée je sais pas encore, pour l'instant tout est en mémoire. Mais je trouve mieux les messages de différente taille, sinon ça ressemble trop à un forum
>>
Hello /wdg/, Django beginner here. I want to have an arbitrary number of fields that will be input into a single column in a database on post.

I know how to make a button to have more input fields appear in JS, but can I somehow have a single TextField take input from multiple fields in HTML/JS and taped back up to be a database input on submit, or am I looking at this the wrong way around somehow? Is there a field-widget or something created for this purpose?
>>
>>59657028
(Pas de framework HTML/CSS non plus)
>>
>>59657028
>>59657236
>>59657261
Speak English you fancy-cheese eating cunts. Other people might want to participate in the discussion.
>>
whats the best way to store a bunch of HTML in a js variable?
>>
>>59656968
Looks COOL. What tools are you using?
>>
I've never worked with a CMS before.
Gonna do some Wordpress, which I'm told is simple and straight-forward.

Does /g/ have any primers or guides on how to get into it fast and efficiently?
>>
https://pastebin.com/SJJTizFc any idea why this is placing a ridiculous amount of padding/whitespace between the bottom of the map and my footer? If I adjust the padding % it resizes the map height as well, and still leaves some whitespace.
>>
>>59656968
FranceChan?
>>
can i make this shorter
SELECT name FROM webms WHERE webms.name NOT IN (SELECT video_name FROM history where session_key='{$_SESSION['sesija']}') ORDER BY RAND() LIMIT 1
>>
I am using pug for the first time, but I don't know if this is the same in regular html, does "Doctype html" act as an opening html tag?
>>
how come when i try a post reuest with php the variables just end up showing in the url? heres my code

$('#updateRecord').click(function (event) {
event.preventDefault();
$.ajax({
url: "updateRecord.php",
method: "POST",
data: $("#formData").serialize(),
success: function () {
alert("success");
},
error: function () {
alert("fail");
}
});
});
>>
>>59659935

nvm my src include of jquery was dun fucked up
>>
>>59658534

>SELECT na FROM wes WHERE we.na NOT IN (SELECT v_na FROM his where session_key='{$_SESSION['sesija']}') ORDER BY RAND() LIMIT 1
>>
File: boiiiiiiyee.jpg (279KB, 1100x1600px) Image search: [Google]
boiiiiiiyee.jpg
279KB, 1100x1600px
>>59634728
>Moving to Seattle at the end of the summer
>Know HTML/CSS/JS + jQuery and Bootstrap

What frameworks should I start learning now to get hired as soon as possible?
>>
>>59660559
>google
>seattle web dev jobs
>look at postings
>keep track of how many ask for x, y, z
>google again
>seattle web dev framework popularity
>glance back at your notes
>take note of which ones are popular
>google again
>using the above filtered frameworks, see if any have upcoming successors/replacements
>learn the frameworks you've ended up with

It's Just That Easy®
>>
>>59654139
If it looks good in chrome, then good. Chrome is the only web browser people should be using nowadays.
>>
>>59660612
So I did what you said and it looks like node and react are the most sought after, which is nice because I planned on learning these soon anyways!

Thanks anon!
>>
What are some well designed sites with well written CSS ?
>>
>>59661320
http://csszengarden.com/
>>
>>59654848

>go on wordpress or Squarespace
>make website with template
>don't tell them shit and offer them a retainer contract so you "upkeep" the website
>laugh all the way to the bank

I make around $5k USD a month from doing nothing at this point with this method.
>>
nodeeeeee jjjjjsssssssss
https://github.com/nodejs/inclusivity/issues/82
>>
>>59661773
Please tell me you aren't memeing, keep hearing that wordpress people make a nice buck

How do I start?
I can into js, c++, python
>>
>>59662586
I literally can't understand what they are talking about
>>
>>59662791
Not him but from experience it ain't a meme :^)
>>
>fourth day as junior dev
>2 pull requests
>haven't fucked anything up too bad yet

This is alright
>>
>>59663087
what did you request to be pulled my man
>>
What are the strengths of:

-Node Js.
-PHP
-.NET MVC
-Ruby
-Python

??
>>
>>59663206
My commits my dude

I don't know if I have a handle on the GitHub lingo desu

I did a couple bug fixes on a Magento site
>>
>>59663219
What an arbitrary list anon
>>
File: wsr.png (2MB, 7360x2368px) Image search: [Google]
wsr.png
2MB, 7360x2368px
This is what I'm working on at the moment.

Someone asked me to make a ripoff of World Scribe as a webapp. I've been looking for a way to give back to the RPG community.

I've been having fun.
>>
File: ClayPuppington.jpg (35KB, 500x375px) Image search: [Google]
ClayPuppington.jpg
35KB, 500x375px
>tfw I use and enjoy using JavaServer Faces for web dev and nobody else uses it
>tfw this is the first web framework I've used
Now I'm going to have baby duck syndrome and hate everything else subconsciously.
>>
>>59663219
Php is only legacy systems

.NET MVC is kinda meh, it's the Microsoft way of MVC so it's stable. But not modern.

React.js and Angular.js are the ways do handle MVC on the client side. It's what all new apps are using.

Python is a language. Django and flask use python for Web Dev.

Node.js is Javascript on the server end. This makes things lightweight and allows for code sharing between server client. Add in typescript and you have a mean stack
>>
Looking at the "how to get started"

Coming to the end of my degree and realize just how useless IT and CS degree's are, I didn't learn hardly anything from the classes, luckily I spent the last 3 years not just doing course work but also doing projects for people.

To be hirable in the industry what would be recommended to be slightly above the average?

My list would be:
Go through w3schools html tutorials from beginning to end
Do the same for CSS, Javascript, SQL, PHP, Bootstrap and JQuery.
learn FTP and Bash

Can't think of anything else right now maybe someone can help me out, I don't feel very confident until I see my classmates then feel like uni isn't representative of my competition.

What would you do as an early 20's white male with basic knowledge of html,css and javascript to get ahead of the competition and land a job?
>>
>>59664010
I'm in the same boat. Started programming in 2009 or something, so realized pretty quickly how lacking the curriculum was. I actually just gave a presentation to a bunch of freshmen about regular expressions and git. Thinking of doing another one for basic shell usage.

Anyway, I've got a list of technology I want to learn: AWS, Jenkins, docker, puppet, vagrant, laravel, webpack.

I've also got a pretty good github link: https://github.com/kamranahmedse/developer-roadmap/blob/master/README.md

That's what I'm trying to do. Maybe this is bad advice if you're really just looking for the fastest way to get a job.
>>
>>59664010
>>59664224
The degrees aren't for learning the tool attachments (ie react) of your career. Rather they're learning the very fundamentals necessary so you aren't a bumbling fool and can actually problem solve. Of course, not every school is up to the exact same standard which mean there are a lot of schools graduating students who can't into basic math.

Anyways, to differentiate yourself you need to basically be 'part-of-the-team' before even getting an interview. This means understanding what the company you're applying to uses, and being fully immersed in that world, or even better being well versed in whatever successor they want to transfer to.

There is no list of frameworks you should know. There is no books you should have read. There is no podcasts you should have listened to. It's all highly region sensitive. What is going on in Seattle is very different from what is going on in Dallas. What google is doing on the web scene is very different from facebook.

Just get to making projects. No employer cares that you finished a book cover to cover, or some online course, or that you only used vanilla JS and refused to use JQ. They care that you can actually fucking ship something. Benefit to working on projects you're interested in: you actually start loving the time you have to work.
>>
File: CyFyMRL.jpg (257KB, 800x1199px) Image search: [Google]
CyFyMRL.jpg
257KB, 800x1199px
>>59664887
I'll agree to an extent, but when someone says, "I took a college-level course in advanced object oriented programming," you expect that person to know OOP. My uni is bad about going into depth, and it's even bad about teaching what was advertised by the course title (at all).

I consider my university unique. What applies to mine may not apply to the rest of the universities.

But again, I'll agree with you to an extent. Maybe "Intro to CS" isn't the place to teach people how to use a shell. On the other hand, I doubt these students will teach themselves. On the OTHER other hand, you can lead a horse to water, but you can't make it drink. If they don't self-teach, that's their problem.

pic related
>>
>>59665746
What's wrong with his arms? they are more skeletal than mine.
>>
>>59662791

Not memeing.

I started doing it for schools because schools are run by morons.
>>
>>59657241

in your html put in a hidden input field with some id and name.

make your submit button trigger some js event or function that populates that hidden input with all the input fields you made and then it submits the form.

when you validate your form or are handling the post request do like
request.POST.get('whateverthefuckyournameis')
and you'll get that hidden field


what sort of information are you saving so that it's entered as multiple text fields into a single column? That seems kind of strange to do....
>>
My website isn't live yet and I don't have a domain yet, can I not add disqus to the site yet? I wanted to add disqus before putting my website up just to test it out
>>
Can I use a shared server for my website, but use a VPN or even a dedicated server for a web application that will be hosted to that same domain? For example website.com uses shitty cheap server since is just a very basic site, but website.com/app uses dedicated server. Also, let's say I make a mobile app for that web app, can it communicate with the same server my web app will use? Or is it better to just use the dedicated server as database and do all the logic in the web and mobile clients?
>>
File: wizdfire.png (21KB, 244x184px) Image search: [Google]
wizdfire.png
21KB, 244x184px
Does /WDG/ have some project suggestions for my portfolio?
Right now it's EMPTY and I want to get HIRED.
>>
File: trump21.jpg (210KB, 962x1168px) Image search: [Google]
trump21.jpg
210KB, 962x1168px
Can someone explain Content Management Systems (CMS) to me, as if I were a retard?

I just don't get their chief use.
Supposedly they are critical, but they aren't mentioned in roadmaps like
>>59664224


Are they used in all applications? Are they vital?
Someone lay it out.
>>
>>59657028
>>59657236
>>59657261

just keep the conversation going. I'm still comprehending. Wanting to learn french without having to go to r/French
>>
>>59657709

youtube channel alecaddd. search wordpress theme from scratch.
>>
>>59642294
>>59645322
If all names other than 'john' are valid, you could do it in one line:
document.getElementById("taken_by").value = data["taken_by"] || "john";
>>
Aspiring web dev here.

Where can I find projects to contribute to?
>>
>>59668284
open source, personal, or paying ones?

open source? Look at issues on technology you use, try to fix simple bugs.

personal? Start off with a simple idea that everyone has done before if you're new to this. Then try and build something of increasing complexity as you get more knowledge. Then you can start to build things that you and others will use.

paying ones? get a job.
>>
>>59653958

Anyone?
>>
>>59668333
I guess it depends on the current dependencies. Is the site being hosted? Does it use any ruby specific dependencies that can't be found on npm (unlikely)? Are people using the site a lot?

We can't tell you how big of an undertaking this will be as that's idiosyncratic to your current skillset.
>>
>>59667905
Bump for /stupid question/
>>
>>59668434
a CMS is any application like wordpress. it's just a buzzword for a graphical application you load to hold your content if you're a blogger or whatever and use to edit and manage it.
>>
>>59642662
What projects did you build?
>>
In SQL, is there a way to select a list of items in a database and then deselect some of those items in the list? In pseudocode

SELECT * FROM items
DESELECT * FROM items WHERE id = 10
>>
>>59668911
And in case anyone says "just use
SELECT * FROM items WHERE id != 10
", I know I can do that already. I'm not asking how to structure this particular query, I'm asking if such a DESELECT function even exists.
>>
>>59668927
>>59668911

You'd use an inline SELECT:

SELECT * FROM items WHERE items.id NOT IN (SELECT * FROM items WHERE id = 10);

Inline selects like these make it great to find all records that don't have any foreign keys in a different table.

SELECT * FROM items WHERE items.item_id NOT IN (SELECT * FROM items_sold WHERE items_sold.item_id = items.item_id);
>>
>>59668911
>>59668927

Wierd question..

In databases you don't just "select and deselect" rows, it's not like objects. You are always looking at (static) Sets and Subsets. What should a "DESELECT" do? Delete stuff from your database?

Maybe you want something like this?

SELECT *
FROM items
WHERE (id > 500 OR id < 1000)
AND some_value = 'yes'
AND id != 666
>>
>>59669142

>(id > 500 OR id < 1000)

Sorry, of course an "AND" would be more apropriate here. But you get the idea:
you can simply chain conditions until you find the proper subset.

And you can also use JOINs and/or Subqueries to get the proper Set.


>>59669059

"NOT IN" is dangerous when NULL values are involved.

As a rule of thumb it's better to use NOT EXISTS or a JOIN with a IS NULL query - unless you know exactly what you are doing.
>>
So, let's say want to prevent users from typing question marks into the URL. If the website detects a ? in the URL, it will instead send the user to the 404 page. Is this possible?

I would assume I need a variable like $url and make it equal to the URL, and then I would search through each character of $url until a ? is detected, and if one is, I would send them to the 404 page.

How do I set a php variable equal to the full URL?
>>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script>window.jQuery.ui || document.write('<script src="/js/jquery-ui-1.11.2.min.js"><\/script>')</script>


Am I right in thinking that is a simple robust way put JQuery in both locally and linked.
>>
>>59669226

>So, let's say want to prevent users from typing question marks into the URL

You can't.

The client-server modell mean the client can always ask anything to the server. It's up to the server to get the right response, i.e. by providing the allowed routes. Even if the server only allows GET requests, the client can always still send a POST request. But the server will probably answer with something like "ERROR 44444: you're an asshat, I don't provide POST requests here..."

So if you don't want to process quotation marks you can sanitize the parameters you catch in your routes, and if it has a quotation mark you redirect. But you can't "disallow" it.
>>
>>59669226
>>59669303

Doesn't this work?

$url = $_SERVER['REQUEST_URI'];
if (strpos($url, '?') != false) {
header('Location: ' . '404', true, 404);
die();
}


Obviously a little unrefined
>>
>>59669329
You can also switch the second 404 at the end to a 303 for redirecting to a different location.
>>
>>59669329
is this what they meant by php attracting cancer devs?
>>
>>59669329

I think we both meant the same thing but use differnt words..

But I agree with this guy:
>>59669344

Technically you can thow every error at everything, but it would be very bad style to indicate "404: ressource not found" just because someone treid to send some unnecessary parameters.

See:
>https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

A "400: Bad Request" would be better, but the best solution is to just ignore the parameters, sanitize the request and proceed normally.
>>
>>59669226
Yes, you can regexp the url.
>>
so in Laravel I'm trying to update a table like this
$thing->fill($this->request->all())->save();

but it is connected to a pivot table and I get a duplicate entries error. Do I detach it first and then reattach or is there an alternate solution?
>>
>>59634728
>discord
>using proprietary spyware
haha good one bro
>>
>>59670581
It's either discord or slack, we don't use toxic shit IT minwagers use.
>>
>>59669296
>JQuery in both locally and linked.
<!--[if lt IE 9]>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js""></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<!--<![endif]-->

<script>
if (!window.jQuery) {
document.write('<script src="/path/to/your/jquery"><\/script>');
}
</script>
>>
File: 1485583318015.jpg (23KB, 378x389px) Image search: [Google]
1485583318015.jpg
23KB, 378x389px
So i am trying to set an oauth authentication server up and this looks complicated as fuck.
Anyone has experience with this ?
Any tips ?
>>
I have text inside a js slider div, but when I change the text inside the slider handle disappears, how can I stop this?
>>
File: beastdominator.jpg (651KB, 848x1024px) Image search: [Google]
beastdominator.jpg
651KB, 848x1024px
>following a Udemy course my [spoiler]mother[/spoiler] got for me
>finally get a hang of HTML + CSS
>get to Javascript section
>second tutorial doesn't even work
>the guy puts the script tag inside of the body tag
>he literally just says "do this and this happens"
>fuck this, it isn't working
>search google for 2 days looking for Javascript tutorials with some sort of curriculum
>can't find jack shit
>someone recommends me a book
>guy doesn't even mention how to implement anything, just goes on about random Javascript shit

Why is it so fucking difficult to find anything worth while on Javascript? Why does everyone just do 5 minute youtube tier videos on random snippets of code and then say "YOURE A PROGRAMMER NOW XDDD"

I feel so bad for my mother paying for this course. Javascript is the third out of 10 sections and I'm scared to go any further with this cuck because he's a fucking hack.
>>
>>59671151
Post code, we'll debug it for you.

I agree that most tutorials aren't helping. I think you should look for videos or books that show practical examples, with small projects.

Also, get used to read official documentation. They are not always clear, but it will help you tons in your career, if you know how to look for things. Especially for new languages that don't have a lot of resources about them.
>>
>>59671151
never used these courses but i guess it's meant as an introduction to javascript, once you get an idea on how stuff works it'll be easier for you to google any specific problem you enconter, to learn new tools and so on
anons have been recommanding eloquent javascript and the you don't know js books, maybe try these
you probably can get access to udemy and other vendor's courses via torrent, i know there are a bunch of these on thegeeks
>>
>>59670553
Have you tried something like:

>Saving Additional Data On A Pivot Table
App\User::find(1)->roles()->save($role, ['expires' => $expires]);


>Updating A Record On A Pivot Table
$user->roles()->updateExistingPivot($roleId, $attributes);


https://laravel.com/docs/5.4/eloquent-relationships#updating-many-to-many-relationships

If it doesn't work, explain your app design and what you're trying to do.
>>
>>59671151
>Why does everyone just do 5 minute youtube tier videos on random snippets of code and then say "YOURE A PROGRAMMER NOW XDDD"
That's basically all video courses by the way. Pluralsight really is the only option in that regard but sometimes the instructors just assume you know X unnecessarily. It's fine though because typically you can just look at language docs to figure it out.
>>
>>59671295
$class = $this->get_calling_class();
$thing = $class::findOrFail($id);

//need to detach tasks to avoid "duplicate entries" error
if (isset($thing->tasks)) {
$thing->tasks()->detach();
}

$thing->fill($this->request->all())->save();

if (isset($this->tasks)) {
$thing->tasks()->attach($this->tasks);
}

this actually works ok since there are no timestamps or incrementing keys

basically I'm using this method to edit multiple different models (course and task right now).

I think I'll stick with this
>>
>>59671334
graphikart on youtube is also pretty good if you happen to be frenchfag
>>
>>59671372
This. If you speak french, he's really good because he goes beyond the basics with actual applications.

>>59671368
I really wouldn't do the whole detach/attach thing. That's making SQL queries for nothing.
To be honest, I don't understand why you have a duplicate entry error if you're only updating your model and not inserting a new one.

What are your relationships like?
>>
>>59671532
courses have tasks and it can update tasks in/out from the course
>>
>>59664010
>early 20's white male
why do you feel it necessary to say your race?

the creator of bash happens to be african american, problem?
>>
>>59671578
Are you feeling offended?
>>
>>59671592
are you?
>>
>>59671563
But in your code, it looks like you're updating a course, right?
>>
>>59671698
it also updates tasks

the problem is the result of me not checking which tasks are already in the course and just resetting the whole relation if it is modified.
So for example if a course has task 1 and 2 and is edited to have task 1, 2, and 3. Then I just remove them all and reattach the ones needed.

Right now the code also updates tasks just fine, isset comes back false if it's a task.
>>
>>59671698
>>59671749
I was trying to avoid writing a different formrequest thingy for tasks and courses. Maybe that was a mistake? Well it'll work fine the way it is because it is not going to handle big loads anyways
>>
>>59671749
That doesn't seem like the right way of doing it.
Wouldn't the sync() method better for that?
>>
File: st.jpg (33KB, 742x371px) Image search: [Google]
st.jpg
33KB, 742x371px
Since no one answered my question I'll ask again, hopefully this image is clear enough.

I'm learning back end and want to create something like this, but I'm not sure of a few things. Can I use one server to host the basic website, and another more robust to host the application, but make both point at the same domain like in the pic? Since I want to have a login system where only users can see their own files, is it safe to use static paths to said files? How do I go about restricting access to the file server? What's stopping anyone from just typing the path in the browser? I'm also looking at hosting websites and none give me the option to have different types of servers, is this something I need to configure on my own? Also, can a non-relational DB do?
>>
sup /wdg/ i'm a computer engineering mostly used to shit like c++, matlab, etc

i don't know shit about web but i just bought a meme domain so i plan to make myself a website for fun

what web-oriented HTML/CSS WYSIWYG IDE should i use
>>
>>59671803
looks like a good solution, I'll try that.
>>
>>59671813
You want to store the files outside of the webroot and control the access from a script.

You can use X-Accel-Redirect with nginx for example.

So map /files/ to your permission.php or whatever, and when the user requests a file you make sure he can view that, then you set the X-Accel-Redirect header with the internal filepath and nginx will handle the rest.
>>
Does anyone have a snippet of code what'll show the current market value of ethereum & bitcoin?
>>
Junior backbone dev here. Got about a years worth of experience on an SPA and about 2-3 years of code monkey markup experience (HTML, CSS and jQuery).

What should I do for the next step in my career? Making $$ is more interesting to me at this stage in my life rather then 'muh career'.
>>
>>59671803
super

if (isset($thing->tasks)) {
//$thing->tasks()->detach();
$thing->tasks()->sync($this->tasks);
}

basically the same thing but I'm hoping this has some 'laravellian' performance benefits or stmn
>>
>>59671855
a text editor is enough for basic stuff, try sublimetext (free key in vault7 files)

>>59671813
> Can I use one server to host the basic website, and another more robust to host the application, but make both point at the same domain like in the pic
You could set your http server up so that it redirects website.com/app/* to another server and host the application stuff there
>>
>>59671958
It has at least the benefit to make your code cleaner. Does that solve your problem though?
>>
>>59672000
The duplicate entries? Yeah, that's no longer an issue. It was only a problem at the start when I wasn't even detaching the pivot table entries. And now I've swapped detaching for syncing.
works like a charm rn
>>
>>59671958
this is supposed to be isset($this->tasks) in case anyone cares
>>
what are the TOTAL costs of using
>https://azure.microsoft.com/en-us/pricing/details/functions/

let's say i only use azure functions and in one month i use 200000 GB-s over 500000 executions, with 50000 GB of total inbound data, 50 GB of total outbound data, how much does it cost?
>>
>>59672191
so the max payload limit is 16MB per invocation, then let's say 5000 GB of total inbound data for the month (0.010 GB * 500000 executions)
>>
>>59672222
or does the 16MB limit only apply to azure-webjobs-sdk-script? fuck if i know, it's so hard to find real information about this crap
>>
>>59672191
>For me personally, it is not only about the cold start/idle issue, but as I wrote in #529 I think it would be good to have some transparency of the scenarios that are targeted by Azure functions.
lol no wonder they're so sparse with actual information, they're so vague to try to make people think they have a use for it, but the actual product is not like what you imagined, what a scam
>>
>>59671855
Sublime or VSC are the only two options quite frankly. Outside of you know the most basic and barebones of text editors.
>>
im trying to run 2 update queries with PDO but getting an error at the 2nd one. Here it is. Anyone know whats wrong?

$qry = $dbh->prepare("UPDATE [RequestItems] SET [item_num] = :item_num, [part_letter_control_num] = :part_letter_control_num, [part_letters] = :part_letters, [comments] = :comments, [control_num] = :control_num, [height] = :height, [width] = :width, [depth] = :depth, [di] = :is_direct_import WHERE [replacement_num] = :replacement_num;");
$qry->bindValue(":item_num", $item_num);
$qry->bindValue(":part_letter_control_num", $part_letter_control_num);
$qry->bindValue(":part_letters", $part_letters);
$qry->bindValue(":comments", $comments);
$qry->bindValue(":control_num", $control_num);
$qry->bindValue(":height", $height);
$qry->bindValue(":width", $width);
$qry->bindValue(":depth", $depth);
$qry->bindValue(":is_direct_import", $is_direct_import);
$qry->bindValue(":replacement_num", $replacement_num);
$qry->execute();
>>
how can I make one css item ignore #parent?
>>
>>59673085
What's the error?
>>
>>59673199
Don't add #parent
>>
>>59673243

cannot call to member function on boolean

at the prepare() part
>>
>>59673257
_num;");

don't think pdo takes ;");
try _num"); instead
>>
>>59673085
What's your code before that query?
>>
>>59673280

yeah it does all my other working queries have that. It's proper sql syntax

>>59673282

this is the working one. Second one is the one that doesnt work

$qry = $dbh->prepare("UPDATE [ReplacementOrders] SET [sf_cust_num] = :sf_cust_num, [date_entered] = :date_entered, [taken_by] = :taken_by, [name] = :name, [address] = :address, [address2] = :address2, [room_floor] = :room_floor, [city] = :city, [state] = :state, [zip_code] = :zip_code, [country] = :country, [phone] = :phone, [e_mail_address] = :e_mail_address, [fax] = :fax, [attention] = :attention, [is_consumer] = :is_consumer, [is_residential] = :is_residential, [proof_of_purchase] = :proof_of_purchase, [request_via] = :request_via, [requested_by] = :requested_by, [action_taken] = :action_taken, [action_date] = :action_date, [shipment_weight] = :shipment_weight WHERE [replacement_num] = :replacement_num;");
$qry->bindValue(":replacement_num", $replacement_num);
$qry->bindValue(":sf_cust_num", $sf_cust_num);
$qry->bindValue(":date_entered", $date_entered);
$qry->bindValue(":taken_by", $taken_by);
$qry->bindValue(":name", $name);
$qry->bindValue(":address", $address);
$qry->bindValue(":address2", $address2);
$qry->bindValue(":room_floor", $room_floor);
$qry->bindValue(":city", $city);
$qry->bindValue(":state", $state);
$qry->bindValue(":zip_code", $zip_code);
$qry->bindValue(":country", $country);
$qry->bindValue(":phone", $phone);
$qry->bindValue(":e_mail_address", $e_mail_address);
$qry->bindValue(":fax", $fax);
$qry->bindValue(":attention", $attention);
$qry->bindValue(":proof_of_purchase", $proof_of_purchase);
$qry->bindValue(":request_via", $request_via);
$qry->bindValue(":requested_by", $requested_by);
$qry->bindValue(":action_taken", $action_taken);
$qry->bindValue(":action_date", $action_date);
$qry->bindValue(":shipment_weight", $shipment_weight);
$qry->bindValue(":is_consumer", $is_consumer);
$qry->bindValue(":is_residential", $is_residential);
$qry->execute();
>>
>>59673085
You fucking retard what the fuck is this shit.

Do
$qry->execute(
array (
':item'=>$item,
':item2'=>$item2
)
);
>>
>>59673381

i dont see how this answers my question. It doesnt matter whether you pass through the execute function or use a bind method I thought. Thats really not even better syntax, either.
>>
Anyone willing to quickly convert this node app from mongo to mysql? I'm working through it now on my own but wanted to get another reference to compare to see if I'm doing it right or not

https://pastebin.com/qwrYPrAj
>>
>>59673501
Sure, I'll do it for $200
>>
>>59673534
eh I just found out about bookshelfjs so maybe not
>>
>>59673085
Check the value of $dbh before that query and also the value of the first $qry.
>>
What hosting company can I get for just a landing page?
>>
>>59673609
Just use knexjs and use Javascript's built in classes or json. Bookshelf doesn't offer anything useful and actually becomes confusing and gets in the way after a while.
>>
Redpill me on noSQL databases.
>>
>>59673950
It's not always the better choice:
>http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/
>>
>>59674018
>4 year old article
>>
$roles = Role::all();

this doesn't give out anything good

how do I get a list of all roles?
I basically just need to grab the 'name' column from role table. Should I DB:: it?
on laravel
>>
>>59674035
What does it give you?

$roles = Role::select('name')->get();

Should give you a collection of all your roles with only the name field.

If you just need an array of all names, you can do:
$roles = Role::select('name')->get()->pluck('name');

Should give you a collection of all the names.

use dd($roles) to see the difference.
>>
>>59674154
Erratum, you don't even need the select('name') in the second one.
>>
>>59661773

How do you get clients?
>>
>>59662791
Just watch a couple of wordpress tutorials and youre set
>>
>>59674154
Gave me a bunch of stuff I didn't need/know how to extract the data I needed from.
 protected 'table' => string 'roles' (length=5)
protected 'connection' => null
protected 'primaryKey' => string 'id' (length=2)
protected 'keyType' => string 'int' (length=3)
public 'incrementing' => boolean true
protected 'with' =>

shit like this. I only need the names and var_dump doesn't even list the names? I think I'm just being a noob though

the 2nd one u gave me is just what I need
>>
>>59674258
ahh I can see that there's actually the
object(App\Role)[266]
protected 'fillable' =>
array (size=3)

in there

so they are in there and I would need to pluck them I'm guessing?
>>
>>59674279
and indeed!
$roles = $roles = Role::all()->pluck('name');

werks too
>>
Thoughts on Heroku? The pricing page is very confusing, what the fuck are dynos? Is storage space scalable?
>>
Am I dumb or something, if I make a simple 6 page website, I copy and paste the header and navbar in every page.

Lets say the site was larger, what would the non stupid way be to put that head and foot in.
>>
>>59675750
a static page generator or offline templating engine or a server side one if your server supports it.
>>
How do I make this not take one million years to complete? anyone knows if it's a indexing problem? it's supposed to be the query that fetches the forum first page sorting by the last post made, TName = thread name, UName = user name etc, there's a subquery in there to fetch the user name for the last post author so I can display "last post by Username" in the html.

SELECT
`t`.`TId` AS `TId`,
`t`.`TName` AS `TName`,
`t`.`TAuthorId` AS `TAuthorId`,
`u`.`UName` AS `TAuthorName`,
ceiling((count(`p`.`PId`) / 20))AS `TPages`,
count(`p`.`PId`)AS `TPosts`,
max(`p`.`PId`)AS `TLastPId`,
max(`p`.`PDate`)AS `TLastPDate`,
(
SELECT
`u2`.`UName`
FROM
`forum_users` `u2`
WHERE
(
`u2`.`UId` =(
SELECT
`p2`.`PAuthorId`
FROM
`forum_posts` `p2` FORCE INDEX(
TId,
PId,
FId,
PAuthorId,
PDate
)
WHERE
(`p2`.`TId` = `t`.`TId`)
ORDER BY
`p2`.`PId` DESC
LIMIT 1
)
)
LIMIT 1
)AS `TLastPUName`
FROM
(
(
`forum_posts` `p` FORCE INDEX(
TId,
PId,
FId,
PAuthorId,
PDate
)
LEFT JOIN `forum_threads` `t` ON((`t`.`TId` = `p`.`TId`))
)
LEFT JOIN `forum_users` `u` ON(
(`u`.`UId` = `t`.`TAuthorId`)
)
)
WHERE
(`t`.`FId` = '1')
GROUP BY
`t`.`TId`
ORDER BY
`TLastPId` DESC
LIMIT 25
>>
>>59675880
I'm too lazy to review this code, but my advice would be to do some research and see how other open-source forum platforms handle this (Phpbb, etc)
>>
>>59675880
>more ( than lisp

Post your ER diagram.
>>
hey /wdg/

how to use iframe to only show a certain part of the page?
>>
>>59677094
I have no idea how to do that but here's the schema if that helps http://sqlfiddle.com/#!9/96bda21
>>
>>59677234
Stop with that T, P, U, shit. What kind of notation style is this?
>>
>>59677266
T for thread, P for post, U for user what's bad about that?
>>
>>59677277
Stop it.
>>
File: 149 - iOHb0.jpg (64KB, 600x398px) Image search: [Google]
149 - iOHb0.jpg
64KB, 600x398px
>>59675880
>Correlated subquery inside another correlated subquery
dude...

Try rewriting that shit with joins.
>>
Is it possible to learn AngularJS in a week for an interview?
this might change my carreer
>>
>>59677776
Depends on how well you know JS already.
Depends on what you'll be expected to do.
>>
>>59675880
>>59677674
To add to that, your query is returning completely random data - you cannot select values which are not aggregate operations or do not appear in the GROUP BY clause. If you do, their values are undefined.

More decent RDBMS will even throw an error and not run the query.
>>
>>59677776
of course it is. web dev "technology" has such little substance that you'll pick it up with ease, and the average webdev doesn't know much of anything so you'll probably fit in just fine
>>
>>59677815
It's not returning random data to me, it takes a long ass time last I tested (300+ seconds) but I got exactly what I was looking for, what I use is basically http://stackoverflow.com/a/21580390 but I modified it alot to get the username of the last post inside each thread
>>
File: 1484174672113.jpg (44KB, 500x355px) Image search: [Google]
1484174672113.jpg
44KB, 500x355px
>>59675880
SELECT
thread,
title,
user,
name,
date,
posts.id,
(SELECT CEIL(COUNT(*) / 20) FROM posts WHERE thread = threads.id) AS pages
FROM
threads
LEFT JOIN posts ON threads.id = thread
LEFT JOIN users ON users.id = user
WHERE
forum = 1
AND date = (SELECT MAX(date) FROM posts WHERE thread = threads.id)


SQL master here. Query me anything.
>>
symfony vs laravel

which one is rite answer
>>
>>59678235
lolphp
>>
>>59678303
shut up nigger faggot hipster trash

go require my dick in your ass
>>
>>59678323
this
>>
>>59678218
Is there a way to learn pretty fast that doesn't involve google and stackoverflow?
>>
File: 1488229602757.jpg (34KB, 800x582px) Image search: [Google]
1488229602757.jpg
34KB, 800x582px
>>59678323
i'm sorry you have to use deprecated technology
no need for rudeness tho
>>
Wait, you can make real desktop apps on Javascript?

good god
>>
File: giphy-162.gif (638KB, 500x400px) Image search: [Google]
giphy-162.gif
638KB, 500x400px
>>59678397
php is the best language for web development, you dont need to agree with that.
That is a fact
>>
>>59678218
I got "ambiguous" error from mysql, after changing it to

SELECT
forum_threads.TId,
TName,
PAuthorId,
UName,
PDate,
forum_posts.PId,
(SELECT CEIL(COUNT(*) / 20) FROM forum_posts WHERE forum_posts.TId = forum_threads.TId) AS pages
FROM
forum_threads
LEFT JOIN forum_posts ON forum_threads.TId = forum_posts.TId
LEFT JOIN forum_users ON forum_users.UId = PAuthorId
WHERE
forum_threads.FId = 57
AND PDate = (SELECT MAX(PDate) FROM forum_posts WHERE forum_posts.TId = forum_threads.TId)

to try to remove the ambiguousness and make it fit my schema the query just never finishes.
>>
>>59678421
https://github.com/Microsoft/vscode/issues/22900
>>
>>59678235
There isn't a right answer. It's two good frameworks with different philosophies.

Symfony is more strict and have its own ways of doing things, so you usually have a good, clean code with it.

Laravel doesn't really care how you do things, it's "easier" to use but you may not always understand what's beneath it because of the tons of magic methods it uses.

If you want to make money, you should see the actual opportunities there are in your area for these two before choosing.

If you want to learn, I feel like Laravel is easier, but maybe that's just me. Maybe because it's closer to the applications I was making vanilla.

You may not even need any of them of your project, there are other alternatives (Slim, Phalcon, etc), but these two are really good.

Try them out on a small example project and see what you like better, what is closer to your coding philosophy.
>>
>>59678471
>a crhome bug by proxy
top php
>>
>>59678575
>relying on chrome in the first place
>>
>Page 8
>>59679034
>>59679034
>>59679034
Thread posts: 328
Thread images: 31


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