[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: 337
Thread images: 22

File: 1490778753512.png (874KB, 824x553px) Image search: [Google]
1490778753512.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
>>
Previous >>59634728
>>
First for PHP
>>
Post some pretty sweetly designed sites. I need inspiration.
>>
First for Go.

tag: golang
>>
If i know a bunch of C# MVC will i have an easier time learning other webdevs?
>>
node.js + angular2 is the way to go

prove me wrong
>>
What's a good barometer for number of processes/threads? I got a 4 core VPS. Tried 4 processes/2 threads and noticed my app was considerably smoother.

As I'm the only one testing it right now I can't judge how it handles concurrent requests, but monitoring system resources shows that there's minimal CPU usage though an extra 800mb of RAM is used than when there's only a single process/thread.
>>
>>59679268
http://templeos.org/
>>
>>59680188
You'll have the concepts down. Models (data structures), Views (templates), and Controllers (routing, app logic).

Try out Go and marvel at how little bullshit you need to internalize before you can effectively write an app.

>>59680245
>single threaded
>callback hell
>runtime errors
>equality comparison fuckery

>angular is thoroughly infected with javascript tool AIDS

node + angular's only merit is that it is widely established (for front-end designers turned web """developer"""), easy to get a job for, and verified SEO-friendly. Google is working on front-end javascript support, though.

Go + Vue.js is the future, my friend.
>>
>>59680665
>callback hell
I'm pretty sure with ES2016/ES2017 that you don't need to worry about callbacks as much since there's now promises, async/await and yield.
>>
I just finished udemy's web developer bootcamp by Colt Steele, how do I earn money now?
>>
How do you guys deal with reactjs license?

https://github.com/facebook/react/issues/7293
>>
>>59681262
Start with doing some projects, if you're out of ideas there are a few android apps (like programming ideas) that can help.

Learn how to use Git and start using it with the projects that you do.

Buy a domain (.work domains are pretty cheap)

Rent a VPS from something like digitalocean or linode

Search digitalocean's guides for installing a LEMP stack

Search digitalocean's guide for securing your server with ufw and fail2ban.

Search digitalocean's guide for configuring HTTPS certificates using Letsencrypt with nginx

List all your personal projects on your site along with previews and the git repositories

Look in to how to use LaTeX and start making your Cover Letter/CV using LaTeX (moderncv or awesome cv are great starting points)
>>
>>59681533
I already use git with heroku and cloud 9

Im not too keen on lemp since this course was mean stack...

thanks for the answer though
>>
>>59679112
You here often?
>>
>>59679268
http://example.com
>>
>>59679268
http://alissa.ninja/paint/
>>
any alternatives to skeleton?
>>
File: react_app.png (45KB, 1319x650px) Image search: [Google]
react_app.png
45KB, 1319x650px
Question about React Development on Local / Server.

Im building a React app with create-react-app for my personal portfolio. For now i cant afford a backend (my hoster allows PHP only) so I plan to make a folder/file structure on my local machine, loop through it with python, push everything to a JSON and then use this json to manage state on my react app.

     {
"content": [],
"file_path": "http://wwwXXX.XXX/REACT_SRC/rg_prev.jpg",
"project_id": "bcfb6729-8111-4993-97c9-a1328dd69131",
"project_name": "rg_prev.jpg"
},
{
"content": [],
"file_path": "http://www.XXX.XXX/REACT_SRC/Simon Game FCC_prev.png",
"project_id": "ae3789b0-2c63-4d2b-bc7c-bc0a67ac9aab",
"project_name": "Simon Game FCC_prev.png"
},
{
"content": [],
"file_path": "http://www.XXX.XXX/REACT_SRC/Tic Tac Toe FCC_prev.png",
"project_id": "8c667c30-2830-4055-a04e-fcb17dfbea23",
"project_name": "Tic Tac Toe FCC_prev.png"
},


my portfolio component loops through this JSON and generates portfolio items in a grid with 3-4 columns with each item with its preview, tags, links etc. onClick loads an array which is stored in content and changes the content section to the right of it.

1.) you have to require() each image asset for webpack to load it but because my image assets are "unknown" i cant develop on the local node server (right?) because you cant dynamically require() images

2.) i can build my app and upload it to my hoster which works perfectly fine. Is there any way to develop with create-react-app on a remote server without having to build and upload every time i've made some changes? How do professionals develop react apps on remote servers?

3.) is there any way to automate this (i'm using webstorm)?

4.) can i use herokus free plan to build my own pseudo-CMS (with python or node) that i can access from anywhere that manipulates the content on my server?
>>
>>59682030
Obviously.
>>
Laravel made this for me
public function view(User $user, User $user)

does this make any sense? how come they're named exactly the same? How do I distinguish them from each other then?
$0 $1? those work?
>>
>>59684670
func_get_args, can't you just rename the second one?
>>
>>59684690
sure I can but just wondering why they're not named user and user1 to begin with
>>
>>59684696
Laravel bug?
>>
I think Vue.js deserves more exposition, it's simpler and more elegant than angular and react and doesn't require transpilers and fad techs to run.

t. web dev who has been forced by management to do a whole site in angular with management approved outdated and buggy angular plugins. never fucking again.
>>
>>59684670
When/where does it give you that?
>>
>>59685353
php artisan make:policy UserPolicy --model=User

it's the --model=User fucking it up
it even 'use \App\User' twice
once for the policy and once for the model
>>
>>59680665
>only merit is that it is widely established, easy to get a job for, and verified SEO-friendly
So in other words, it's the only combination worth using. Thanks for the input m8!
>>
Anyone use Python? How can I optimize?

I tested generators against for loops. They're marginally slower but apparently good for memory optimization.

It looks like Python is never going to be as fast as Node which I don't necessarily mind, though I might test PyPy out.
>>
Very simple one but my vocab is shit.

How would you call it when you scroll and it changes the page? reroute on scroll? Any framework, or even React I don't care.

trying to find a demo of something like that
>>
>>59685559
It uses the HTML5 History API, so start there, don't know if there's a specific name for what you're looking for.
>>
File: query explain.png (11KB, 974x144px) Image search: [Google]
query explain.png
11KB, 974x144px
>>59675880 here, I think I fuckin did it after all these hours

EXPLAIN

SELECT
t.TId,
t.TName,
t.TAuthorId,
u2.UName as TUName,
t.TDeleted,
p.PId,
FROM_UNIXTIME(p.PDate/1000)AS PDate,
p.PAuthorId,
u.UName AS PUName

FROM forum_test_posts AS p

LEFT JOIN forum_test_threads AS t
ON t.TId = p.TId

/*
LEFT JOIN forum_test_users AS u
ON t.TAuthorId = u.UId OR p.PAuthorId = u.UId
*/

LEFT JOIN forum_test_users AS u
ON p.PAuthorId = u.UId

LEFT JOIN forum_test_users AS u2
ON t.TAuthorId = u2.UId

ORDER BY p.PId DESC
LIMIT 50


the only thing I've noticed is how I have to limit it otherwise it never finishes but it's getting the job done, any problems you guys can see with this query?
>>
>redid 15 files because I had one namespace wrong and I did not realize
not even salty
>>
best way to get webm duration in php or js?
>i dont want to include some masive script if it is possible
>>
>>59685725
Call ffmpeg from PHP
Or create a video element and check the length in seconds.
>>
>>59685583
thanks had a look it's not exactly the thing but will keep looking around
>>
Anyone using/used an uncommon language or tool or library for web dev? How's the experience?
>>
>>59681262
how long did it take you to do the course?
>>
Is there any profit in making Wordpress themes?
>>
>>59685756
yes i know i can call ffmpeg, ffmpeg is already in use for this app
>using it to create gifs from videos for thumbnails
how could i grab just duration value from ffmpeg output?

I have video element, i use video.js so duration value cant be found
>>
>>59681899
>cloud 9
I'd like to signup there but it requires creditcard#

What about heroku? is it free?
>>
/r/place is a pretty cool idea.

Reminds me of the milliondollarhomepage
>>
I'm using node and express, I have a route which gets a count from one table and renders the page using jade, when I visit the page normally it works but if I start opening alot of pages at the same time the app just freezes and never stops loading. How do I even begin to debug this
>>
Is there any way to use Visual Studio on my machine and edit files on a hyper-v virtual machine or remote server?
>>
Just getting into wordpress.
Still tinkering around with the CMS.

How do I set up a landing page as the main page.

All I can do in the CMS is fiddle around the edges; add more or less blog posts.
>>
>>59686989
What i want is to hammer my already made HTML into my page. Which file do I edit? What option do I set?
>>
>>59686989
https://make.wordpress.org/training/handbook/user-lessons/setting-a-static-page-as-your-homepage/
>>
>>59687035
https://wphierarchy.com/
>>
>>59686974
share the files and open them as usual.
>>
Need some advice /wdg/.

I've got 2 options
>stay in shitty paid junior web dev position while gaining a university grade qualification and has high job security and flexibility and i use standard wamp stack
>move to junior dev position with 3 times my current pay BUT low job security and can use wamp stack but also must learn java and will be under very high scrutiny and pressure due to regular work reviews

what do?
>>
>>59687374
your best option is to kill yourself.
>>
>>59687397
>t. jealous neetfag
>>
>>59687374
second option, job security is a relative concept in web dev, you'll never stay unemployed for too long
also java is prety gud
>>
>>59687374

Not employable wannabee here, but I agree with >>59687551, you'll learn more and that pressure will be good for you if you can handle it.
>>
Certified best stack:

React + Mobx front end. Try it and you will feel like a retard for ever using anything else.

Whatever the fuck you feel like back end. I like AWS lambda (js or python), Koa (js), and Flask (python). Go also looks pretty cool too despite garbage-tier null handling
>>
is this proper way to create class?
<?php

class autoplay{
public $video;

public function __construct($video){
$this->video=$video;
}

public function setPlay($video){
$this->video=$video;
$address = "Handy-Vids/".$video;
$duration = shell_exec("ffprobe -v quiet -print_format compact=print_section=0:nokey=1:escape=csv -show_entries format=duration ".$address);
$ref = intval($duration);
header('Refresh:$ref /handy/');
}
}
>>
>>59687723
make $video private, don't set it in your setPlay method, use the existing one from the constructor.
>>
Anyone ever made a new site for a local company and then offer to sell it to them?
>>
What is the difference between VS Code and Visual Studio?
>>
>>59688017
>google
>>
File: Librechan(1).png (112KB, 1907x1635px) Image search: [Google]
Librechan(1).png
112KB, 1907x1635px
Is this UI too bloated or ugly? The advanced board settings only show up if you click the button.
>>
>>59688058
Too many fields at once, use tabs or something so you only see what's related to what you want to do.
>>
>>59686540
Yeah fuck cloud 9. Fucking amazon wanting credit card numbers for non-premium accounts, I've never heard of such fuckery in my life. I wouldn't use them out of spite.

Yes heroku is free for your first dyno. For more than that it costs money.
>>
File: Librechan(3).png (54KB, 1907x881px) Image search: [Google]
Librechan(3).png
54KB, 1907x881px
>>59688094
Looks like this on pageload. I mean it will only be used a few times and doesn't need to look pretty as its admin only.

It has some kind of descriptions atleast lel
>>
>>59688164
Still too much, if you're bothered by not having good UX you should keep the focus only on what's important.

As it is right now you have to read through all the fields before you know what does what.

I'd make the buttons stand out a bit more as buttons also, when disabled they look like text fields.
>>
>>59688214
Yeah I'm gonna restyle them. I'm just a very bad UX designer, it's the part I hate the most desu.
>>
>>59688164
I'd try to keep new/rename/delete buttons in the same order for each section. And try to make them look more distinct. Maybe use links for the non-destructive actions (e.g. show boards, advanced settings)
>>
>>59688340
That's a good idea, I will make the destructive actions associated with red, the changing actions neutral like and the creative actions as green.

Makes sense too to fix the order, did not even think about that.
>>
>>59688308
I read the UX board on SE when I have some time over at work, helps with the thought process.
>>
>>59687723
You should follow PSR's for your coding style.
>http://www.php-fig.org/

Also you're sanitizing and properly escaping $video, right?
Else, read about command injection.
>>
>>59689161
>www.php-fig.org
tnx for this

>Also you're sanitizing and properly escaping $video, right?

i dont rly know what this means but i use trim and strip tags on $video.
>>
File: Librechan(4).png (58KB, 1907x881px) Image search: [Google]
Librechan(4).png
58KB, 1907x881px
>>59688340
I feel like it looks like total shit now. I really can't design for shit.
>>
>>59689244
>http://php.net/manual/en/function.escapeshellcmd.php
>http://php.net/manual/en/function.escapeshellarg.php
>>
>>59689278
dood pick a few colors using a color wheel and stick to them
use something like this https://color.adobe.com
maybe darken / lighten some colors if you really need more than 5 colors for those buttons
i can't into graphic design but this should already help
>>
>>59689278
You're the reason why the likes of Bootstrap ships with a bunch of default shit. Use it to your advantage instead of creating a hideous monster.
>>
>>59688017
text editor with features vs full fledged ide
basically
>>
spring boot + angular frontend

what's your opinion
>>
>>59689990
That looks cool. I will create a color scheme then and keep all buttons blue.
>>59690094
I know but I'm not using bootstrap. I do mobile support with pure CSS. And yes that color scheme is an ugly behemoth.
>>
Hey, I am new in this and I am doing a personal project in php.

I have a database with a total of 75 char entries. I already run a function to remove all the stopwords from it. Now I need to take a random entry and compare it with the rest of the database and get the 4 most similar to the random one out of it.

Any suggestion on what could I use for the similarity? Should I search for some algorithms or simply use the integrated similar_text function?
>>
>>59690288
Even if you're not using Boostrap (or alternatives) look at their default situation. As inspiration. https://bootswatch.com/default/

Notice how it all looks uniform. How even though the colors are all different, they operate on a tetradic basis, and the colors hold obvious meaning (success = green).

You do not have to reinvent the wheel in design, doing so typically leads to really bad results.
>>
File: doggokeyboard.jpg (9KB, 236x174px) Image search: [Google]
doggokeyboard.jpg
9KB, 236x174px
Pretty new to web development. Can anyone give me a possibly simple resource to host and display images. I'm currently using heroku and node.js Also looking for a comment system as well that isn't disqus.

I'm looking to have the photos and comments be in small separate squares around the page.
>>
>>59690172
spring boot is comfyness made into a library
not sure why angular seems to be used this much with spring boot, it's an ok front end framework anyways
>>
>>59685522
Pythons advantages come in less for any UI frontend stuff, but it excels in automation because of how easy it is to write, leading to a vast amount of libraries. I am a backend automation guy and Python is my bread and butter, but my Nodejs guys on my team handle the forward facing things.
>>
>>59690601
I'm convinced now. I'll use bootstrap for these things, that will save me a lot of nerves.
>>
File: xxzz.jpg (153KB, 995x1076px) Image search: [Google]
xxzz.jpg
153KB, 995x1076px
hey fellas, i've been away from webdev for a while. is react still alive? what are the latest trends?
>>
>>59691290
React is king of frontend right now for sure, don't listen to the vue babbys and Angular shills
>>
anyone into /functional JS programming/ here?
I have an array of functions with the same signature, and I want to reduce them all into a single function. How tho?
>>
>>59681503
There is nothing to deal with
>>
>>59691407
>for sure, don't listen to the vue babbys
vue has superior MIT license without all facebook bullshit though, is react much better still?
>>
>>59685457
doesn't make node good

lots of production code is just waiting to run into runtime errors
>>
>>59691437
Not really sure what it is you are asking for. If you want the single function to return an array of the results from the functions then you can do this:

const first = (a, b) => a + b;

const second = (a, b) => a - b;

const combine = (...functions) => (a, b) => functions.map(fn => fn(a, b));

const combined = combine(first, second);

console.log(combined(5, 2));
>>
>>59691722
>node is not good

how did you fall for this meme?
>>
I use a lot of LINQ and Entity Framework with C#, are do the other webdevs have similar things?
>>
>>59692017
>are do
Do*
>>
>>59692017
I think laravel has a query builder similar to linq and you can generate a database with code first.
Java 8 has streams now which work similar to linq, but no idea if it works for SQL as well.
>>
>>59691935
having an education in computer science and learning all about software bugs, not to mention experience using scripting languages and their runtime errors

node is the meme
>>
Can someone guide me how to install a php stemmer on windows because it seems I am an actual retard. I found this stemmer among many others https://github.com/camspiers/porter-stemmer

>install composer
>create a compose.json with the code in the folder the rest of my code is
>run composer install
>try it
>Fatal error: Class 'Wamania\Snowball\French' not found in C:\wamp\www/the folder
>>
>>59692090
If your best argument against nodejs is lack of compile time checks I feel bad for the time you wasted getting your 'computer science education' where you learned 'all about software bugs'.

If you want handholding in JavaScript there are options for you - I actually have professional experience with JavaScript (unlike you), and I would never in a billion trillion years give up the flexibility and development speed JavaScript provides by using TypeScript or similar tools.

Your sole argument against nodejs is something you can literally just opt in to. Come back to me when you actually know what you are talking about - the echochamber that is /g/ is not qualified to discern what is good or not, so you should probably stop letting them decide what is good or bad for you.
>>
>>59692359
not him but which tech community are you from mate
>>
>>59692507
Wouldn't say I belong to any tech community
>>
>>59692664
>too shy to say where he comes from
what communities do you lurk faggot
>>
>>59692251
See if the following works better:

composer require camspiers/porter-stemmer
>>
>>59692251
>>59692951
Also, if you have no composer json yet do this before:

composer init


Then this: >>59692951
>>
>>59692725
/g/ and /r/javascript - the latter has some links to various articles and helps me keep up to date, but is really only interesting if you care about JS.

I don't browse any of them daily or feel very attached to either, hence the 'I don't really feel I belong to any' comment. Satisfied? :D
>>
>>59692980
> /r/javascript
> :D
> comes to /g/ to criticize our community

interesting
>>
>>59691828
this is a good start thanks, enough to figure it out on my own
I didn't word my problem well. I'm looking for a middleware-kind of pattern where I only get a single value in the end.
>>
How hard is it to get into porn sites? As in just embedding other videos?
>>
>>59693407
Super easy if you're just embedding.
>>
>>59693542
I mean is there any money in it
>>
>>59693556
You're not going to be a millionaire, but you could probably host it on Scaleway for €3/month and not be lossy at least.

It's going to take time to manage and add videos and find decent ad providers, though. So deciding how much your time is worth would be wise.
>>
>>59693556
No, substantial amount of that money is nonexistent because of adblockers.

You can try and create some premium curated platform that charges a sub fee or something idk.
>>
>taking web dev class
>"ok now we will make an alert box say what is in our <p> tag."
>copy everything word for word
>it doesn't work

<!doctype html>
<html>
<head>
<title>Learning Javascript</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />


</head>


<body>

<p class="text">Some text</p>

<script type="text/javascript">

alert(document.getElementByClass('text').innerHTML());

</script>

</body>

</html>


[spoiler] pls no bully, i am literally copying what this professor does.[/spoiler]
>>
>>59694263
Remove () after innerHTML
>>
>>59694263
>>59694275
And learn to read the console to see what went wrong.
>>
>>59694263
>pls no bully, i am literally copying what this professor does
You shouldn't. You should type it out so it gets at least sketched into your memory.
>>
File: image.jpg (178KB, 501x1222px) Image search: [Google]
image.jpg
178KB, 501x1222px
>>59694263
try with
alert(document.getElementsByClassName('text')[0].innerHTML);
>>
>>59694263
getElementByClass returns array of dom elements so do >>59694424
or use getElementById and use ids instead
>>
>>59694317

I am. I meant I'm copying what he types. I'm not copy/pasting everything.

Even he says in the videos "just copy paste this, its quicker"
>>
Been working on a collab drawing app over the past few weeks. I put it live for the first time yesterday. Just updated it to version 0.1.1 which fixes a few bugs.

Here's an example room:
http://www.drawy.io/d/qboikjv36py18zz6
>>
I am making a programming language C++, it's only feature right now is printing to the screen, to do that you type in "LangOut("YourTextHere");", anything else you type in will give you the basic syntax error I added, and if the line is empty it'll tell you so:

#include <iostream>
#include <string>

using namespace std;

int main(){
string languageVersion = "0.001";
string line1;
string printx = "LangOut('";
string printy = line1 - printx, line1 - printz;
string printz = "');";
getline(cin,line1);

if(line1 == printx + printy + printz){
cout<<printy<<endl<<endl<<"You are using version "<<languageVersion<<"."<<endl;
return 0;
}

else if(line1.length() == 0){
cout<<"Write some code to execute."<<endl<<endl<<"You are using version "<<languageVersion<<"."<<endl;
return 0;
}

else{
cout<<"Syntax error."<<endl<<endl<<"You are using version "<<languageVersion<<"."<<endl;
return 0;
}

return 0;
}
>>
>>59686158
about 1 month, maybe less. I was grinding hardcore and doing all tasks and even making some of my own projects.
>>
how does one get this special shit wrapped around their code >>59694263
>>
>>59694563
Pretty cool anon
>>
>>59694641
Read the sticky.
>>
File: extra-large_012217021532.jpg (36KB, 647x404px) Image search: [Google]
extra-large_012217021532.jpg
36KB, 647x404px
>>59694563

Looks nice, needs undo function though
>>
>>59694620
That is really sad looking shit
>>
I can't update visual studio 2015 Enterprise to 2017 Enterprise right?
>>
>>59694620
So much autism.
>>
>>59694762
I am thinking that it might end up being a weak little scripting language like JavaScript or Python.
>>
File: Mitchell Henderson.jpg (18KB, 350x416px) Image search: [Google]
Mitchell Henderson.jpg
18KB, 350x416px
>>59694732
I am making a Hello, World application via C++ in Visual Studio, what are YOU doing anon?
>>
>>59694900
I'm making an internal web system for the company i work on.

They are moving their website to google sites and I'll have to rewrite their very old web apps for internal hosting inside a VLAN, I'm remaking them in C#.
>>
>>59694969
PFFF, I am doing way more than that in my Hello, World application.

Seriously though, C#? Just... why?
>>
>>59694996
It's a web app anon.
>>
>>59695036
Still...
>>
>>59694900
eh was an hero 2 us all
>>
>>59695043
Ok anon I'll make the app in a desktop environment using C++ Electron to code it in java script, just for you.
>>
>>59695079
No, JavaScript is worse.
>>
Hey /wsg/, is accessing SQL from PHP actually complicated, or am I just retarded?
>>
>>59695233
Both, but more of the latter.
>>
>>59695233
The latter.
>>
File: rearded.gif (1024KB, 218x228px) Image search: [Google]
rearded.gif
1024KB, 218x228px
>>59695265
>>59695262
>>
I wrote fgmail.com at work yesterday and it redirected me to a porn site while my boss was watching.
>>
>>59694563
Pretty nice work
>>
>>59695330
I love this post for some reason.
>>
>>59695287
Quantum Leap provided us great meme material.
>>
>on desktop
>giant res
>visit site
>hamburger menu
WHO THE FUCK
>>
>>59691722
Then use typescript with strict null checks you fag, literally 0 runtime exceptions
>>
>>59692359
Fellow professional Javascripter here. You literally give up nothing using typescript. Have you even tried it?
>>
Any other professional webdevs feeling unsatisfied with their line of work? Or hell, even people in the general tech field.

What difference am I making in the world by building this fucking shitty login system? Future generations won't be looking me up in the history books and say "Wow, I'm sure glad anon built that CMS for us, it really changed the world."
>>
>>59696871
People in the tech field are fucking cringy people. I dunno about webdev yet but almost every one I've met has been toxic.
>>
>>59696871
psssst
future generations literally don't matter, also stressing over what future generations will think of you is a guaranteed path to irrelevance.

>>59696931
Hold up a mirror once in a while.
>>
>>59696961
I'm probably just considered rude or short. I've had an ongoing voice issues so I don't really speak unless I have to and I don't bother explaining it to people anymore.

If you don't think people in tech aren't weird as shit you're not paying attention.
>>
>>59697263
>If you don't think people in tech aren't weird as shit you're not paying attention
Humans in general are pretty cringy and weird dude, if you haven't noticed such you're not paying attention.
>>
>>59696961
Forgive me for not wanting to be another useless schmuck on the obituaries that nobody gives a shit about, I want a legacy
>>
>>59697291
Yeah but especially tech guys.
>>
How do I pretend to give a shit at webdev interviews?
>>
>>59696871
Honestly would being a shelf stacker be any worse?
>>
>>59695330
Have you tried going to pen island.com?
>>
How the fuck do i learn this shit.

I just downloaded node and installed express, and i cant figure out how to do a damn thing.

I am on express's main website trying to do the basic hello world guide and it is telling me to run npm init and name my file index.js and then it is saying create a file and call it app.js in another section...like does it matter? do i need an index.js file and then i can also use app.js as another file to run the hello world example?

This example here represents basically everything about my journey into webdev so far. Everything is so fucking complicated and it doesnt need to be. Like why cant i just find some place to start that walks you through step by step- from literally installing node to making your own webpage? Like is that so fucking much to ask for?

It is so frustrating trying to learn this shit. I feel like it should be really straightforward but for some unknown reason everything is separated into a thousand different areas and half the struggle is trying to figure out what is supposed to go with what.

FUCK. This shouldnt be that hard. Maybe i am just retarded.
>>
>reading php.net array functions() manual
>scroll down to comments
>mostly goldmine wisdom posted 8, 9, 10, 13 years ago
>thought to myself "damn, these people are probably rich by now, while here I am climbing the steep hill with my trusty clawhammer and nail
>>
>>59698866
var express = require('express');

// Create express app
var app = express();

// Tell Express to serve the public folder so that every file in your public folder can be accessed.
app.use(express.static('public'));

// Or use custom routing logic
app.get('/', function(req, res) {
// req (request) is an object that the user sends
// res (response) is what you can send to the user
res.send('This is the home page');
});


app.get('/hello', function(req, res){
res.send('This is the hello page');
});


// Listen on port 3000
app.listen(3000);



Now just save that as server.js (or anything), go to your console and type "node server.js"
>>
>>59695502
Have only tried it really briefly when testing angular 2, so you probably know better than me.

I come from a Java background and precisely the thing I like about JS is how much you can do with less code - runtime bugs are just not a pain point for me, so I don't personally see the need for extra verbosity. That being said I'm sure it's great for certain personalities/teams/projects.
>>
I need to have a web interface, that accesses some sql like database that also has to be accessed by a Java app. What database should I use, and what should I write the web interface in (as someone who is self taught in basic HTML and CSS)?
>>
>>59700327
Should your web interface only show data or also modify it and for what purpose?
>>
>>59699333
Yeah okay now include...
> a HTML templating engine
> sessions
> CSRF token
> proper css/js resource management
> SQL access / ORM
> mongo db access
> auto forking
> auto restart
... to create something remotely resembling a production ready node.js application.

And don't forget that proper build pipeline!

Welcome to hell.
>>
>>59679268
The Spora ransomware web panel.
>>
File: zch.png (122KB, 1141x2200px) Image search: [Google]
zch.png
122KB, 1141x2200px
>>59688058
>>59688164
Here's how I solved it. Note this is a textboard, not an imageboard.
>>
Anyone here have experience with Launchcode? Have an interview in a couple days.

What sort of experience/projects did you have and how'd it go afterwords.
>>
>>59700459
That looks pretty comfy. I will copy your style and list all boards in a table and create an edit page.
>>
>>59700459
all these jumping input elements and them sticking to each other.
>>
>>59680665
>rendering markup on the sever
>not serving static files with little to no JavaScript
Please kill yourself
>>
>>59692017
Code first databases are aids. Sql databases are the wrong thing to use 9 times out of 10 anyway.

Try a document store (RavenDB is pretty default for C#) for simple data or a graph database for more complex structures.
>>
>>59701382
I was accepted back in February of last year. I'm not in one of their "partner cities" so I was told I would have to wait for a while. I waited over a year while updating them with new things I was doing. I ended up getting a job by just applying to places.

Another anon was located IN one of their bigger partner cities. They didn't get placed for months either. They ended up getting a job by just applying places too.

Basically launchcode sucks balls and needs to rethink their business model.
>>
>>59702175
Also launchcode is supposed to set you up with a 15/hr contract to hire position. I'm not sure about the other anon, but I'm definitely making more than that and I suspect he is too.

LaunchCode did nothing but eat time.
>>
>>59697676
That was the prank to do 20 years ago.

>>59697545
I ask them about the company and how they got started, where they are going etc.

It shows interest in the company and you don't have to talk much because they love talking about the company. My interview was answering coding questions then just smiling and nodding for about an hour.
>>
>>59702175
Yeah I'm applying to some others as well but hey i there is a shot wouldn't hurt.

I'm in a decent sized tech city which is a partner so here is hoping.

Ended up focusing on PHP when it looks like .net or some hipster language would have been better but worst case I can get a wordpress mill job for a year

>>59702198
What they say is that is just for a month or two until you get hired where they say the average is 50k.

Junior position I applied to not from them advertised starting at 55k-60k and it's the only proper PHP junior position i've actually seen advertised in a month of looking actively.

Honestly at this point I'm just lookign for anything that'll keep me from having to work on wordpress for a year before getting something else
>>
>>59701679
Why are they aids?
>>
I'm working on a personal site to mess with some more complicated CSS elements and I have a few questions on where to start.

I have a bunch of icons that link to my stuff side by side, but among these, there are some things that don't have a link and are just a tag, so for these I would like a small box to open beneath these links with that information.

What should I look into for this?
>>
>>59702490

a tooltip?
>>
>>59702508
Oh nice, I didn't know this existed. Thanks.
>>
>>59702238
I could get you a job in Texas doing PHP by tomorrow if you passed the extremely basic code test.

If you're not down to move, then just apply everywhere for all positions besides senior-level and for any language. There's nothing wrong with Wordpress places either. They usually pay 30 an hour and will deny you if you're not awesome with Wordpress. I was denied a job by several of them. If it adds web developer experience to the resume then it's not useless.
>>
>>59700390
senpai don't do it in node, use java and enjoy everything being autoconfigured
>>
>>59700459
neat
i can't into eleven speak either
>>
How do I make an inline list, but while also using certain CSS elements on certain list items, without a div, which causes a line break?
>>
>>59702848
You use certain CSS definitions to solve the certain problem.
>>
>>59697409
Here's the reality. You're going to work your ass off trying to create a legacy and no one will fucking remember you. Get over it and instead focus on just living a good life instead of trying to appease public perception you cunt.
>>
>>59696871
>>59696961
>>59697409
>>59702960

Get a family and build up a good community around you

if you are trying to get life fulfillment out of making fucking websites you need to rethink some things
>>
>>59703057
>Get a family and build up a good community around you
Or just, as I said, live a good life in whatever way you perceive a good life to be. If you are fulfilled making websites then so be it. Who are you to claim people need to rethink things because they're fulfilled in a way you aren't?

But chasing after some "legacy" is a fools chase.
>>
>>59702508
>>59702490
>>59702539
Is anyone aware of a way to change the height of the tooltip box created? I can change it's width, color, etc, but I have no idea how to make it taller.
>>
>>59699333

Thanks.

So i must be confused on how to structure my folders.

I have a main project folder- but then should i literally have a folder called "public" inside that that has .html files?

I am confused like what is my main .html page and how do i make other html pages that i can link to from the home page.
>>
Beginnger here, this is probably very simple. I got no clue though.

Codesource: https://www.w3schools.com/howto/howto_css_modal_images.asp

Pasted into here: https://jsfiddle.net/adLy7uus/

everything works, you can click on the text and the box appears as it should.
Now, if I were to copy the entire HTML section in order to get a second instance/image going it shows up just fine, but the box wont open on click.

I recond this has something to do with javascript, and most likely with the variable usage. But I am a java noob and cant figure this shit out. HELP, please.
>>
>>59703150
I acutally look at studies at what make people fulfilled and satisfied with life and it perfectly lines up with traditional morality and a basic understanding of evolunary psychology.

Long term monogamy and kids = most fulfilling thing a person can do
a Job should simply be a means to that.
>>
>>59703607

Well you need to change the IDs in the javascript to target the second modal.

So you can copy the javascript and change the IDs to the second modal.

Also if its all on one page you will need to change var span = document.getElementsByClassName("close")[0]; to a 1.
>>
How do I earn money with wordpress?

What skills do I need to acquire?
What actions to I need to do?

I already know HTML/CSS/Javascripts. etc
>>
>>59703612
I highly doubt that. What field do you work in and which studies are these?
>>
>>59703716
Eh, is there no way to have one single javascript that globally works on all instances?
Like you have one CSS that may target an enitre gallery of images.

I do not really want to copy the entrie things multiple times.
>>
>>59703880

There is, but not like it is set up in that example.

I would recommend using bootstrap for something like that. It is really easy to do modals and things like that.

Check out https://www.w3schools.com/bootstrap/bootstrap_modal.asp

It is really cool and pretty easy to use.
>>
>>59703717
php

get to writing plugins & building WP sites
>>
Let's say I have a list of elements like this:

Sample1
Sample2
Sample3

And I want the user the order them so I can update OrderNumber in the DB. What's the best way to approach this. The first should have 1, the secondary 2 and so on. The users should dynamically move the element and then click a save button.
>>
>>59704241
if the list is small enough then up and down arrows on each element to move them should do it.
if it gets larger then add drag & drop and manual numbering with text input.
>>
>>59704241
There are a lot of right ways to do this and I have no idea how your program is written so I can't even offer an opinion.
>>
All your problems can be solved using an if else.
>>
>>59704309
Probably 10 elements max. Text input is what I thought already. I will probably implement that as it's the easiest to do.
>>59704324
I've never done that before, just give me some sort of idea. Guess I won't be able to dodge JS in this one.
>>
How can i have 2 constructors in php in same class
i need one to have 2 parameters
and 2nd need to have 3 parameters
>>
>>59704706
I don't think you can.

But you could have one __construct and one you call init or something and you call it from constructor on certain conditions.

What are you trying to do exactly?
>>
>>59704706
you can't, php can't into overloading because it isn't type safe.
make two static create methods that create the new object and initialize it based on one or two parameters instead.
>>
>>59694732
No you have to buy the new one cuz Microsoft jews
>>
>>59704737
>>59704748
ok tnx

>>59704737
>What are you trying to do exactly?
Well when i pass parameters to class sometimes there need to be 3 sometimes there is 2. Those parameters are generated on specific pages and i cant predict how many will be.
I mean i can put static value if(!isset) or some shit like that, ill see which is the best solution.

I asked because i was using that on my software engineering classes back in time, but that wasnt php :D
>>
>>59703716
>>59703956
Bootstrap... Looks good, but that'll take another day to take in. Thanks!

Though, even when I change the Id names and target them it now work that both thumbnails open an image, but they both open the same one... ugh.
>>
>>59704835
you still use the same id twice.
this is a wrong approach to do these things though.
you want one modal element and switch out the image instead of creating a different modal for every image.
this just multiplies your markup and javascript.
>>
>>59704823
Can't you simply place your third argument in the end?

public function __construct($p1, $p2, $p3 = null) {}


Maybe you can also work with func_get_args()
>https://secure.php.net/manual/en/function.func-get-args.php
>>
>>59704870
>
public function __construct($p1, $p2, $p3 = null) {}


this can do it
>>
>>59704392
If I code I dont use anything else
else
>>
File: Librechan(5).png (47KB, 1907x881px) Image search: [Google]
Librechan(5).png
47KB, 1907x881px
Anon with the cluttered UI here. I redone that monster and created two extra pages for advanced settings so it's not so bloated.

I think this is enough to not confuse a user totally.
>>
>>59705081
Looks so much fucking better holy shit good job anon.
>>
>>59705302
delete your account bitch
>>
>>59705081
Look up the definition of acronym
>>
>>59705081
Looks like Minecraft menus
>>
I'm pretty new to Laravel, and trying to implement my .csv download function as a controller method.

How would I rework this to function in Laravel? It's mostly the mysqli_fetch_assoc while that's throwing me for a loop.

$sql = "select * from products";
$result = mysqli_query($connection, $sql) or die("Selection Error " . mysqli_error($connection));

header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename="export.csv"');
header('Cache-Control: max-age=0');

$fp = fopen('php://output', 'w');

while($row = mysqli_fetch_assoc($result))
{
fputcsv($fp, $row);
}

fclose($fp);
>>
>>59685583
Got what i wanteed, http://browserstate.github.io/history.js/demo/?state=3

History.JS seems deprecated though. But made giant steps now!
Thanks anon !
>>
>>59705253
Thank you!
>>59705445
Changed it now. But in some cases it is an acronym like /qa/ - Question & Answer or /t/ - Torrents
>>59705477
kek'd
>>
Okay friendos.

Is there a defininitive guide to learning node.js?

I looked at the OP and every time i try and find a resource it eventually gets me to some Indian guy using deprecated methods and confusing the fuck out of me.

I would be happy purchasing a book or something if there is one that is just really really good out there.

I'm trying trying to fully grasp javascript but i want to begin learning how to host my own website and then start doing applications that transfer data and shit. So far every time i try and google something i get more indian shit.

Any help bros?

Also i would be interested in learning express- i think? Any good resources there?

Thanks
>>
>>59705633
To imitate what you've already have:

$products = Product::all()->toArray();

header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename="export.csv"');
header('Cache-Control: max-age=0');

$fp = fopen('php://output', 'w');
foreach ($products as $product) {
fputcsv($fp, $product);
}
fclose($fp);


Or if you don't want to write in a tmp file, you could do:

$products = Product::all();

$headers = [
'Content-Type' => 'text/csv',
'Content-Disposition' => 'attachment;filename="export.csv"',
'Cache-Control' => 'max-age=0'
];

$callback = function($item, $key) {
return implode(',', $item->toArray());
};

$products = $products->map($callback)->toArray();
$content = implode("\r\n", $products);

return response($content)->withHeaders($headers);
>>
>>59706532
By the time you publish a book on node.js it's already outdated.

Just try to find very basic tutorials explaining what it is and how to use it.
>>
>>59706547
Thank you, really appreciate it.
>>
Well /wdg/ which route do I go? Rails or Django? The number one thing I care about it finding a job in webdev. I don't really know if I want to go front or backend. Do I need to know that before picking a framework/Lang?

Plz halp
>>
>>59707453
How many times does it have to be said? If the number one concern is finding a job, then look at job postings in your area and become what they want.

If you don't even know if you want to do front/back/full, then you might want to at the very least do some basic shit in either field to understand which you enjoy more.
>>
>>59707469
I've done the basic shit already. I was just looking into picking a first language outside of JS.

My area is fucked for jobs so I'll have to move, and I'm OK with that but I thought wdg would know more about the state of the languages than me. Are Rail jobs even a thing outside of San Francisco and New York?
>>
>>59706561

Ive tried that- i cant even make my own server with html pages. I am so hopelessly lost.

Guess ill keep reading javascript books until something kicks in.
>>
>>59707539

>Are Rail jobs even a thing outside of San Francisco and New York?

weworkremotely.com

Rails is disproportionately remote compared to other frameworks due to DHH and Jason Fried nut huggers.
>>
File: 0d73cc203c4a9c73a8ef8d289b6db0ee.png (647KB, 1200x837px) Image search: [Google]
0d73cc203c4a9c73a8ef8d289b6db0ee.png
647KB, 1200x837px
What are technical interviews at smaller webdev agencies like?

I mean places that sell template webshops and the like. I can't imagine them doing whiteboard interviews.
>>
>>59708012
just know that its very relaxed and all smiles because they are desperate for talent
>>
What can I use to compare how alike two texts are in php? I don't want to compare characters but words in a string
>>
>>59707741
Thanks much for the link and info anon. I guess that's a good thing. Except that I'll still never have friends this way.
>>
>>59708083
I think you meant to type that into here: https://www.google.com
>>
>>59708120

I tried already, I am just finding char comparison and other stuff. I need something to compare text based on words
>>
>>59708083
Example?
>>
>>59708083
look up strcmp()
>>
>>59708092
You'll never have any friends regardless.
>>
>>59708190

For example I have three string:

>Hello world
>The world is dying
>We have to help our dying world

They go trough a stopword removal and stemming script. Then they should get compared. Comparing the first and second should give me an index or percentage, comparing with third should give me 0. Comparing 2 to third should give me back a higher index.

I know I can write it up with arrays to compare each single word but I feel that would take a long time and I would rather avoid it if some algorithm for stuff like that exists.
>>
>>59708269
naively i would order each strings stems alphabetically then use levensthein or some other basic string comparison algorithm
>>
>>59708345
otherwise index your stuff in solr or find a way to integrate existing indexing / search frameworks like so
http://www.lucenetutorial.com/techniques/lucene-php.html
>>
>>59708251
T-Thanks Y-You too anon.
>>
>>59708345
>>59708389

Thanks for the suggestions. I'll try the first one for now.

Probably would be easier to do something like this in python or R but I need it to make it dynamically and fast.
>>
>>59708434
I'm just being honest, and you don't even want friends past your 20s because they all end up getting married and ditching your ass in favor of their wife/husband/dogslut.
So enjoy loneliness and find someone who will put up with (and possibly love) your autistic ass instead of basic 'friendship'.
>>
>>59708495

I am actually thinking of creating a independent script that I will pre-run to compare each single word in the array and create a custom weighting, something like how many similar words are there divided by the number of words.

Then those values I will put into a new table and when running the script it will cross reference the index in the tables instead of comparing it on the fly.

I think it's not really an optimal solution but hopefully should be fine for what I need.
>>
Well I went through the Lynda.com javascript and programming basics. What the hell do I do now? Follow javascript tutorials to do specific things?
They just taught the basic concepts nothing really web specific or practical applications.
>>
>>59708744
searching and indexing text content is a complex problem, you shouldn't make stuff up if you're working in a professional environment and this is not intended for a hobby project
i'm a huge pleb at this shit but what you are describig looks like pre indexing tf-idf for a bunch of pre defined values. I guess you could work out a a scoring method taking into account the tf-idf values for each request term while having those values pre computed when indexing documents but there probably are way more efficient and proven methods available
either use some premade libraries for this or learn how this works

if the latter, i recommend these.
https://www.youtube.com/watch?v=nfoudtpBV68&list=PL6397E4B26D00A269
>>
File: Screenshot_3.jpg (23KB, 518x511px) Image search: [Google]
Screenshot_3.jpg
23KB, 518x511px
help
>>
>>59709232
.4
>>
>>59709232
go through the process bitch
>>
>>59709232
Lets see.

if Y is greater than X
OR Y post-increment equals 4
AND Y pre-increment equal 5

y > x (true)
++y == 5 (y is now 5) (true)
Enter first block.

Is this how it goes?
>>
>>59708914

It's for my master but the webpage is a minor part of it, collecting the data from the webpage from users and analyzing it is actually my master.

All the literature I found about this problem says that the problem is actually complex and they try to compare it with using the WordNet library and nlp algorithms which I assume is either too hard or most likely impossible to actually implement in php.

I think I will need to break down the text into words and compare them using a custom ranking after all. I tried something similar now and it's actually really fast so I can do it dynamically too. Of course I will discuss it with my mentor too.
>>
Can you be a front end dev and suck at design?
>>
>>59709610
it depends on the nature of the documents you are going to index but you could basically use something like solr or elasticsearch as a db for them then use the provided search features to do queries. there might be php libs available to integrate those dbs out of the box, otherwise they both have http interfaces so it should be easy to get it to work
i did something similar with elasticsearch about 5 years ago, it worked ok
>>
>>59709232

Shouldn't it be x = 1, y = 4?

Or does the increment in the condition actually change y's value permanently?
>>
>>59709889
see >>59709503
>>
>>59700361
It needs to be able to both modify and read.
In all honesty, it's for Minecraft. I'm working on a server, and the unique features I plan on implementing do not fall under one of the pre-existing web integration suites.
Also apologies for the delay in replying. I'm switching from nights to days at day job, so my schedule is all screwed.
>>
>>59709232
(y > x) (4 > 2)
True, so there's no need to look at the OR condition.

... AND (++y === 5) ((4+1) === 5)
True, this is pre-increment meaning that the value of y here will be incremented in its place.

Difference between pre-increment and post-increment:
++y === 5;// (4+1) === 5
y++ === 5;// 4 === 5 (plus one to y next line)

x is now assigned 1 because (true AND true) equates to True so the first route is taken. The else route is ignored.

Result: x: 1, y: 5

This is a good illustration on how if statements get processed and also why you should never mutate a variable inside an if statement unless you have good reason.
>>
>>59709232
just save it and run it.
>>
I got a pdf-page layout and i want to make it so if the body content is too large then move the signature below it.

How do i do that?

Here is it
http://www.bootply.com/gAbwYQBKRy
>>
so which of you faggots are 4chan devs
>>
>>59712450
my dad works for bungie
>>
>>59679034
How do I use jQuery to pull the 4cham api json into a json object?

I've looked everywhere else within reason but it all points to getting a .txt file and converting it.

I literally want to grab the json from a url


<p id="demo"></p>

<script>
var JsonObj = {"name":"susan"};
$.getJSON('https://a.4cdn.org/g/catalog.json', function(data) {
document.getElementById("demo").innerHTML = JSON.stringify(data);
JsonObj = JSON.stringify(data);
});
document.getElementById("demo").innerHTML = JsonObj;
</script>



it's just displaying [object Object]. what do?
>>
>>59713416
>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://a.4cdn.org/g/catalog.json. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
>>
Can you guys recommend Heroku?
>>
>>59713416
1. You will likely have to proxy it through a server you own, as browsers won't allow you to request data from another server (CORS)

2. try console.log(data);.
>>
>>59713654
useful for quickly deploying small concepts and ideas. Haven't toyed with it much beyond this - haven't had to pay for anything.

What I do not like is that they require a CC on file for certain features. It's up to you if you think it's worth the hassle of setting up in whatever dev env you use
>>
>>59713654
Anything like it like digitial ocean or anything is good for setting up a vps/portfolio for your site

The difference between them isn't that big so there are some cheap ones you can go with or just whatever has good tutorials

not much to say about them past that though or heroku in particular it's a competent vps
>>
>>59713686
>>59713584

I thought the purpose of JSON was to provide a way of sharing data, all I want to do is search for a thread and put it on my local homepage if it exists.
>>
apiRouter.route('/comments/:comment_id')
.put(function(req, res) {
console.log('hit route');
let Id = req.params.comment_id;
let author = req.body.author;
let text = req.body.text;
let opacity = req.body.opacity;
connection.query('UPDATE comment set author=COALESCE(?,author), text=COALESCE(?,text), opacity=opacity+1 WHERE id=?',[author,text,opacity,Id]), function(err, result) {
if (err) res.send();
console.log("result: " + result);
res.send("poop");
};
})


is there anything glaringly wrong with my sql? I'm trying to update the author and text values unless they're null via COALESCE. I get my 'hit route' console log but it dies when it hits the query
>>
Best hosting service that deals with nodejs?
>>
>>59714017
>rent cheap vps
>host whatever the fuck you want
>???
>>
>>59699033
meanwhile im out here unable to use 6 month old javascript tutorials
>>
>>59710436
Use PHP and MySQL. It's easy to learn for your purpose and also easy to deploy. Use PDO instead of mysqli and look into prepared statements.

To read data create some functions that use the data to build HTML. For modifying use inputs and build queries from the POST vars.

You can do it pretty fast and it will work™. You don't need any framework for that, PHP 7 is enough.
>>
For some reason ubuntu doesn't log my user in automatically, I have to run su user after logging in. Anybody encountered this before?

Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-66-generic x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud

7 packages can be updated.
7 updates are security updates.


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

$

>>
Senpaitachi should I learn clojure
>>
File: 1484039285598.jpg (193KB, 900x602px) Image search: [Google]
1484039285598.jpg
193KB, 900x602px
>>59716813
considering learning it (or scala) as well
could some functionnal fag pls highlight the pros and cons of not giving a fuck bout functional programming vs learning one of the aforementionned language vs ditching jvm alltogether and learning lisp ?
is it finally time to read sicp ?
>>
Isn't there a way to check all checkboxes from a page without doing a function ?
I find it strange that all the solutions I find only propose to make a function for this.
>>
>>59713712
All portfolios should be @ github pages (or gitlab pages). All actual projects should be @ DO/Heroku/etcetcetc.

You save money this way.
>>
>>59716903

>not giving a fuck bout functional programming

pros:
-a new paradigm is work
-more languages to remeber

cons:
-you would miss a lot of fun
-you will not unlock beast mode in non-functional languages with functional parts, like JavaScript


>learning one of the aforementionned language

pros for Clojure:
-beautiful and logical language
-small and clean, easy to remeber
-modern

Cons:
-LISP syntax (some people hate it, some love it)
-not like CL (subjective)

pros for Scala:
-"one language to rule them all", like C++
-smoooth and logical syntax in the beginning

cons for Scala:
-gets freaking complex after a while, a lot of non-orthogonal concepts
-some pitfalls you need to know about
-needs more time to get halfway decent, rather for experienced programmers


>ditching jvm alltogether and learning lisp ?

pros:
-alternative ecosystem
-LISPers get +10 reputations on all job positions


cons:
-not that many jobs
-idealisitc

>is it finally time to read sicp ?

yes.
yesyesyes.

Just do it, invest one month of your precious time and work through it, it's so worth it and will make a lot of things clearer. It's also pretty well written.


K&R and SICP are mandatory for everyone that waynt to call himself a programmer.
>>
>>59709889

>Or does the increment in the condition actually change y's value permanently?

Exactly.

consider the following:

var x = 1;

if (x++ === x-1){
console.log("x is now 2.");
}



While "x+1" and "x-1" heve no side effect, "++x" and "x++" do.
>>
if im joining some tables together in SQL but i dont have data in one of the tables when the page loads, i get an error because that query fails since theres no data in that table to match it up with the other tables. Eventually on the page they will add data to that table via form, but how do i prevent the error in the first place?
>>
>>59717933

$('input:checkbox').prop('checked', true);
>>
Should I resize my images manually (which means cropping every single image in photoshop before uploading) or automatically with CSS? What is better?
>>
>>59713724
And you can do that, just not through browser's AJAX request the way you're doing it.
If you're desperate, Greasemonkey lets you write scripts that can circumvent browser's in-built cross-origin restrictions.

https://wiki.greasespot.net/GM_xmlhttpRequest
>>
Can I install and use Nodejs on Godaddy servers?
>>
>>59719806
I just checked their site, yes you can.
>>
>>59718792
If you do it with CSS the user will still download the entirely image. If your image is small that's no issue but if you want to display a 1MB image as a 500x500 thumbnail you shouldn't use CSS for it.
>>
>>59720018
The backend is resizing the image anyway, it's just so you don't have to crop it for the right aspect ratio every time, and it's also better for responsiveness I believe.
>>
Outside of web development, can't find any other thread though, can I ask? (C# .net)
>>
>>59720081

This is a programming general:
>>59718594

You can ask here as well I guess (I won't know the answer, but someone could).
>>
>>59720081
> do not ask to ask, just ask
>>
is this how I create an sql table with the table schema defined in a file?

person.sql
CREATE TABLE Persons (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);


mysql -u root -p [DB_NAME] < file.sql;
>>
I need to go through a list of questions and change the question displayed after an answer is given. How do I loop one-by-one with vuejs?
>>
>>59707453
>Make a Flask project
>It's fucking easy and quick to make
>Decide to try out Django since everyone likes to meme about it on lebbit
>Install it, start making project
>The fucking folder structure is an autistic fucking mess
>In order to fucking map a single url and render a page, I have to fucking go and edit 3 python files and fucking import 4 functions
>Have to do fucking stupid ass regex to map urls as welel, whereas in Flask I just fucking use ENGLISH god damn it
>It takes 5 minutes to make a fucking dynamic URL in Django, and it takes literally 30 seconds in Flask
>Comes with a shit ton of stupid ass fucking garbage preinstalled
>"LE BATTERIES INCLUDED :DDDDD"
>SQLAlchemy is fucking terrible and a pain in the ass to use for a small project, and for a large project it's a nightmare
>But it's the standard in Django
>If I were using Flask, I could choose what fucking terrible shit I wanted to use and not be locked down. Batteries included shouldn't == "Batteries included, and the battery panel is locked down and sealed with a welder."

Django is fucking terrible. Jesus Christ. Every line of fucking code I write on the backend makes me want to fucking go use Flask.

I can't wait for Flask to supersede Django and kill this fucking meme framework off.
>>
Do you know any convenient way to read a binary file using AJAX, and processing it as Single precision floating point numbers (float)?

I want not to use JSON because it's data generated by a microcontroller, and stringify those numbers add useless overhead on my functions.
>>
>>59720897
http://jsfromhell.com/classes/binary-parser
>>
>>59720299
Depends on your RDBMS system.
Why not try it and see what happens?

Also the plural of "Person" is "People", not "Persons".
>>
>>59720977
>Person is a singular form, and its plural is persons. Over the time, however, many writers started to adopt people as the plural form of person, and nowadays it is widely accepted. Notice that legal and very formal texts still use persons as the plural form.
>>
>>59720067
As long as the image size is reasonable do it with CSS. I also control my thumbnails size with it.
>>
File: 1472078298500.jpg (9KB, 284x284px) Image search: [Google]
1472078298500.jpg
9KB, 284x284px
>>59720299
>no auto increment
>no primary key

Anon, I know you can do better!
>>
>>59720755
Yeah I ever wanted to try Django but the app system, the regex URLs trigger the shit out of me.
>>
I'm a 26 year old anon who is considering code bootcamp because I'm getting too old to be floating through life anymore and it is driving me really crazy

Is web dev a viable career for someone my age? I mean as a means to retirement, home ownership, etc. Not only that, but are gainfully web devs here happy with their work/life balance in general?

I am really afraid of being trapped in jr to mid level roles as I do not have a compsci degree, I do however have an associates degree in an unrelated field so I at least have those credits.

I just have this horrible analysis paralysis and time seems to be slipping away faster and faster the older I get. It is really tough to look forward and try to be productive instead of dwelling on time squandered.

I've built up a decent curriculum with resources and projects for self learning but have not been able to commit myself out of fear that it will end up being more wasted time if I find myself disillusioned with this in the future.

Idk what I'm really asking. This isn't /adv/ after all. But figured it is the best place to ask.
>>
>>59721315
If you want to have a relaxed environment do backend stuff like Django, Rails, PHP and its frameworks or even Java stuff that interstates with a frontend.

All the meme devs are frontend only and will fuck you up with their weekly ''must have'' frameworks. And you'll stuck with JS forever - unless you like that chose wisely.
>>
>>59721315
We have a guy who learned webdev at 40 in my office and switched careers from something completely unrelated.

As for work/life balance it depends completely on the company you're working for, it's probably more slack than most jobs in terms of strictness as long as you do what you're supposed to.

Happiness only comes if you enjoy the work.

Good luck.
>>
>>59721379

I'm relatively talented/skilled on the creative front and have an interest in that area but feel like it is more competition and less pay, am I wrong to think this or is their money on the creative side of dev?
>>
>>59721315
All careers that don't involve physical training are typically fine for any age. In a moments notice any career can completely vanish, so you should stop focusing on 'careers' and instead focus on providing value. There are PLENTY of web devs who have been effectively replaced by squarespace/wordpress. Still, there are also plenty of web devs who have just gotten better at what they do/provide a niche/crafted their own value and they're still raking in the big bucks. So stop focusing on whether or not it's worth it, start focusing on what is you enjoy fucking doing.

Whether or not you're actually going to strap the fuck in and start creating is a completely different story. You won't start doing so until you figure out your personal identity instead of mindlessly chasing some job. So really, your question to yourself should be "okay, what the fuck do I ACTUALLY want, and how to I get that". Figure it out.
>>
>>59721444

putting in years of practice only to be replaced by some gui cms web app shit is a real fear of mine as far as this shit goes
>>
>>59721499
It's a retarded fear caused exclusively by this idea that skill and value are these static things. They just aren't. Your skill depreciates the less you use it. The more you use it, the more you create, the better you get. As technology and the world progresses, the easier complex tasks become. You can either make money making some of these tasks easier, or you can become a relic of the past. So yes, of course eventually there will probably be some 3 step program that sets up 99.9% of websites/web apps, but that doesn't mean suddenly web devs are going to go extinct, they will find other avenues. Broadly speaking, more devs are looking to incorporate AI. More devs are looking at VR as another interface to expand on. These are just broad general examples, not things I'm advocating you look towards.

So really, it's completely up to you. Your fear is unwarranted. There won't be this moment where you suddenly wake up and go "omg google just released a product, my career is fucking over!", you would have (hopefully) over all these years continued learning new cool shit.
>>
File: web.png (268KB, 1920x2220px) Image search: [Google]
web.png
268KB, 1920x2220px
Does it matter much if the server for my app is hosted in another country? Providers in my shithole are all fucking garbage and expensive, most of them don´t even give you root access and have very limited bandwith unless you pay an arm and a leg.
>>
>>59721626
No, as long as you have good peering it's definitely fine.
>>
>>59721626
Nope. Unless I suppose it's supposed to be this exclusively local app for whatever reason.
>>
>>59721719
Not exactly exclusive but I don´t see anyone outside of my country using it.
>>
>>59721758
Yeah then it's still fine to use servers hosted in other countries.
>>
>>59720755
The funny thing is, in Java, you map URLs in ONE place.
Django made Python worse than Java:
> Play framework has one file called routes and guess what that does?
> Spark allows you to just tell it about the paths, and it's up to you not to make a mess out of things.
> Old school Java ENTERPRISE Edition has Web.xml which does this one and only one place in a reasonably readable format. It's just method calls, like "get("/", Static::createIndex);" after all.)

So how the fuck does Django fuck that up? If Java has gotten it down to dirt simple text files that gets parsed, why can't Python?
>>
File: tumblr_n4tbeu6ziT1r7kzgyo1_400.jpg (25KB, 376x500px) Image search: [Google]
tumblr_n4tbeu6ziT1r7kzgyo1_400.jpg
25KB, 376x500px
>>59718379
Thanks a lot m80 !
I shall become master of the parenthesis
>>
>>59720755
>>59721311
>>59721914
>Be Roy, live in the town known as 'Flask'
>Really enjoy this city. Everything is nice and simple, the roads are smooth, know everybody around you, and getting to the essential buildings like the post office and the store is as simple as just driving/walking for 15 minutes or so and going in.
>The buildings are never too crowded, the roads are always moving along, there's hardly ever any traffic, and everyone has a smiling face.
-
>One day, Roy decides to go visit his brother, Gaf, who lives in Django, which is the next town over.
>Make the drive over, and on the way into town, get stopped in a traffic jam as far as the eye can see.
>The deeper into town Roy gets, the more foggy and smogged up the sky becomes from the toxin emissions from all the processing plants and factories everywhere that are left on, even those that have nobody working in them. Infact, some of them have no employees at all. Nobody even knows what those factories and processing plants even are for. They're just there. Nobody uses them.
>Roy finally makes it to Gaf's neighborhood after a series of 3 hour lefts and rights all over the road. The town's streets are filled with terrible potholes and cracks. The town officials' attempts at fixing a few cracks just lead to ugly, large mounds of cement over a few of the roads.
>Literally a fucking maze.
>Not to mention everyone he sees in this town looks like they're about to fucking go on a Columbine spree, or rob him.
>Finally reach Gaf's house.
>It's in a little cul-de-sac, and the houses, including Gaf's, are all overgrown and look like they haven't been maintained in years.
>Exhausted, Roy enters Gaf's house.
-
>>
>>59722247
>Gaf doesn't understand Roy's complaints about the town.
>Roy complains, "There's too many roads! They all just lead back to the same road anyway!"
>Gaf responds, "That just means you have the ability to take any route you choose! It was done that way on purpose!"
>Roy complains, "The roads are full of potholes and ugly cement mounds!"
>Gaf reponds, "That's just the town officials focusing more on adding to the town rather than improving on what already works well enough!"
>Roy complains, "But what about the terrible black sky? And the awful smell in the air!? And all the factories and plants everywhere!?"
>Gaf responds, "We may not use some of those buildings, but they're nice to have, and it makes perfect sense to have them on all the time even though it's not needed, because someday we might need to use them!"
>Roy responds, "is that why every god damned light in your house is turned on? And why you have all this junk all over your house you don't even use?"
>Gaf responds, "Precisely! One day, I may have to use something laying around here, you never know!"
>Roy responds, "youre a fucking fag"
-
fresh oc
inb4 django memelord uprising
>>
>>59722264
kek
>>
>>59722264
lmao django keks in 3..2..1..
>>
how would i call a query that returns multiple rows and then convert it to JSON properly? I'm only getting one row returned.....theres an array in one of the arrays...my query is dun goofed
>>
>>59722505
Is it PHP? What are you using to get the results?
>>
>>59722543

so i need my query to join 2 tables I know that part, but i need it to show all the rows from table 2 that are matched with the id in table 1

example: each "order" has multiple "items"
>>
>>59722669
So basically like this:

SELECT items FROM table1 t1 LEFT JOIN table2 t2 ON t1.ID_Order = t2.ID_Order WHERE t1.ID_Order = 1;

But what kind of language you use to convert it to JSON?
>>
>>59722730

php/pdo

i tried that first but didnt work. It only returned 1 row. I need the JSON to look something like this:

{"order_id": "1234", "item_num": ["1", "2", "3"]}
>>
>>59722811
Do you use fetchAll()? It will return you an array with all rows that match the query and you can build your JSON with foreach().
>>
>>59722842

yeah im using fetchAll. My query is still fucked up tho because its selected all the rows. Not just the ones matched up. I have to add LIMIT 1 just so it wont try to load all the data.
>>
>>59722909
Can you post your query?
>>
>>59722926

SELECT ReplacementOrders.*, RequestItems.* FROM [ReplacementOrders] JOIN [RequestItems] ON [RequestItems].[replacement_num] = [ReplacementOrders].[replacement_num] WHERE [RequestItems].[replacement_num] = [ReplacementOrders].[replacement_num] ORDER BY [ReplacementOrders].[replacement_num] DESC LIMIT 1;


probably some noob mistake
>>
>>59723053

ok nvm this i forgot to bind the order number. It works now BUT im getting an array of objects now in the JSON.....closer but not there yet. It's not quite like this yet

{"order_id": "1234", "item_num": ["1", "2", "3"]}


it goes like this instead

[{"order_id": "1234", "item_num": "1"},
{"order_id": "1234", "item_num": "2"},
{"order_id": "1234", "item_num": "3"}]
>>
>>59723148
That makes sense, the query is right I just checked it.

Do you use json_encode on the data?
>>
>>59723318

yeah i am. After the query I have

$qry->bindValue(":replacement_num", $replacement_num);
$qry->execute();
$data = $qry->fetchAll(PDO::FETCH_ASSOC);
$JSONdata = json_encode($data);
echo $JSONdata;
>>
>>59723053
SELECT .., ..., GROUP_CONCAT(item_num), ...
FROM ...
INNER JOIN ...
WHERE ...
GROUP BY order_id
>>
File: s.png (4KB, 376x32px) Image search: [Google]
s.png
4KB, 376x32px
>>59723406
So like this?

Hacked pleb solution here:

$res = $stm->fetchAll(PDO::FETCH_ASSOC);
foreach($res as $data) {
$items[] = $data['ID_RequestItems'];
$id = $data['ID_ReplacementOrders'];
}
var_dump('{"order_id": "'.$id.'", "item_num": '.json_encode($items).'}');
>>
>>59723461

didnt change anything
Thread posts: 337
Thread images: 22


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