[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: 313
Thread images: 30

File: 1487701743799.png (731KB, 824x553px) Image search: [Google]
1487701743799.png
731KB, 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
>>
second for php
>>
>>59840446
What language should I learn first if I want to become a webdev? Apart from php, js, html and css.

Or should i just board the framework boat?
>>
>>59841549
What's your goal? Work for someone?
>>
>>59841549
What kind of job do you want?
High pay, less stable, less predictable, more learning?
Medium pay, mildly consistent, somewhat predictable, some regular learning?
Lower pay, most consistent, most predictable, least learning?
>>
>>59841549

Short answer:
Check your local job searches for developpers.
It doesn't really matter that much t.b.h., start somewhere.

Long answer:
>js, html and css
Mandatory.

Then it depends:

>Node + React + React
If you really like JS and have a funky hair cut.

>php
If you want to go full LAMP stack (which is not a bad option IMHO).

>Ruby or Python
If you don't like php.

>Go
If you want to ride the latest hype train and finally want to come out of your closet.

>Java
If you want particularly long working days but get slightly more money.
>>
>he doesn't run his own blog
enjoy minwagecuck status lmao
>>
File: 1405306297097.jpg (120KB, 1280x720px) Image search: [Google]
1405306297097.jpg
120KB, 1280x720px
J A V A
>>
>>59841694

Not him, but what would you recommend for the three options you listed?
>>
>>59840446
I need help with HTML. Nowadays there are thousands of different frameworks, multiple browsers that thinks their implementation of rendering HTML is correct, and the introduction of HTML5 meant so many new stuff that it's almost hard to follow.

And since mobile is getting more and more popular there is a need to deal with responsive design.

It used to be so simple, where standards are followed by all browsers, and things just work. What happened?
>>
>>59841872
>It used to be so simple, where standards are followed by all browsers
like when
>>
>>59841872

>It used to be so simple, where standards are followed by all browsers

What am I reading here?
It exactly the other way arround..

15 years ago you had to try out half a dozen differnt browsers, you had the whole "w3c vs. whatwg" competition going on..

Today most things work for most browsers, even that terrible microshill thingy is finally capable to not crash things into oblivion.
Responsive webdesign is a breeze, even if you are not using the de facto standard (Bootstrap) there's so many small and nice libraries for that.

If you care about the somplete HTML5 stuff you are doing it wrong. Nobdy cares about some obscure features nobody wants, but the core of HTML5 works pretty well in every reasonable browser.
>>
File: 1490387021441.jpg (147KB, 982x1024px) Image search: [Google]
1490387021441.jpg
147KB, 982x1024px
I know i will get a lot of shit for this question but ill shoot anyway

So i have an idea for website. Its really simple - you upload a pic, it is stored in a DB and later you get feedback o. It.

What would be thr easiest/best way to achieve this?

Catch is i have 0 experience in webdev but i am willing to learn and build it myself from scratch.

What lang/framework should i use?

I am currently a unix admin, so maybe python/django would be the best way to go?

Appreciate all answers
>>
File: 1490358001621.jpg (36KB, 700x375px) Image search: [Google]
1490358001621.jpg
36KB, 700x375px
how do we fix CSS?
>>
File: C7S0ouqVAAANACj.jpg (39KB, 639x424px) Image search: [Google]
C7S0ouqVAAANACj.jpg
39KB, 639x424px
>>59841995
>So i have an idea for website.
>Its really simple
>Catch is i have 0 experience

>>59842023
Stop trying to treat it as anything more than a stylesheet~~~
>>
>>59841995
just learn basic web technologies like html css js, then pick a web framework for the backend based on whatever language you're allready proficient with so you don't have to learn everything from scratch
also learn how to manage databases and sql if you don't already know
>>
>>59841995

Webdev is the art of knowing 100 pieces, that are simple in themselves, but difficult because there are many things to know.

Yes, Python, Ruby or PHP might be a good start, since there are frameworks that keep a lot of the difficult stuff away from you.

But it won't be easy as first project, maybe consider a simple site first to get a rough idea.
>>
>>59841727
>node + react + react
fyi he prob meant react plus redux
>>
>>59842079
no he actually meant react + react + react
>>
>>59841763
>Top paying
Most volatile are going to be working for startups, free-lance, and other places with lower job security. This would be using trendier and newer prototyping tools as well as older ones listed in later categories. I'd put React, Angular, Vue, Azure/AWS, GoLang into this category. Additionally one would have the ability to be adaptable in any project, ready to learn to use and leverage the advantages of a technology within 2 weeks of a project's start. Confidence is also a large part of being in this category, confidence in one's abilities and confidence in one's own risk tolerance.

>Medium
Medium will work for places with slightly more job security: consulting firms, contracting firms, larger startups with VC funding. Tech includes the following plus those listed in the next category: AngularJS/Ember/or Backbone, Ruby, MEAN Stackā„¢, LESS/SASS, task runners like Gulp and Grunt, knowledge of how to leverage a common IDE like VS to use things like TFS or Git, basic knowledge of a content management system like Wordpress.

>Low
Low will work for consulting firms or contracting agencies with long-term (possibly government) contracts or at a larger business with a large development team. Back-end languages are king here: C#, .NET, Java, Python. Front-end tools will be the most stable and well established: jQuery, vanilla javascript, functional programming libraries like lodash/underscore. Databases are also king so SQL, basic database viewing tools, and basic understanding of database normalization are absolute musts.
>>
File: reece.jpg (27KB, 504x415px) Image search: [Google]
reece.jpg
27KB, 504x415px
>>59842023
Bootstrap
Can't struggle with css if you don't write any
>>
>>59842090

Kek.
>>
why do people drool over node.js when it is in javascript and therefore single threaded? isn't that a major issue for big projects?
>>
>>59842111

Interesting point of view. Thanks for writing it all down.

Those repeating digits are absolutely justified, if I dare say so.
>>
>>59842409

Nonblocking, asynchronous I/O.

Also if the raw CPU power is your bottleneck, you are good.
>>
>>59842409
http://stackoverflow.com/questions/5200821/grasping-the-node-js-alternative-to-multithreading
>>
anyone know here something about heuristic evaluation ? need some help with it .
>>
>>59842529

I probably don't know about it.
>>
>>59842023
Use more floats.
>>
>>59841995
just curious what are the most common things you need to know to do unix-like system administration. it's my dream job.

you're going to need to know html/css and either python/django or PHP for what you're trying to make. for the database if you use something that uses SQL you should know a little bit about that but also you might need to know how relational databases actually work. IMO there's a huge meme about PHP being a shit language but they work hard to make it extremely compatible with MySQL.

you don't need to be an expert on any of these topics and you can really just learn as you go, i learned enough html+css, PHP, and SQL to be able to make a dynamic website that can store and retrieve database info in about 3 months of casual learning.
>>
I don't understand why everyone shits on React. Coming from a traditional language background, working with ES6 + React was what finally made Javascript bearable.
Most available JS code (including tutorials) is completely unstructured and unreadable. Especially anything corrupted by JQuery's touch of shit. A more traditional approach to modularity is a huge improvement imo.
>>
>>59842851
>I don't understand
You should have stopped there, thx
>>
>>59842802
Thanks for great reply! Any resources you could point me to just how do i start building a website from scratch?

For unix admin i actually didnt need much, but i am working as junior admin still. Well you need to know mostly basics how fo navigate in linux but what you need more knowledge in is network basics and storage technologies basics.
>>
>>59842802
Depending on how much you know about writing markup and scripting, Codecademy has tutorials for HTML, CSS, PHP, and SQL. If you want YouTube videos thenewboston has tutorials on all of those topics too. W3Schools has good readings on all of these topics as well and I often use them to get quick references if I forget how to do something. One textbook I read for the server-side scripting, database management and querying was "PHP and MySQL for Dynamic Web Sites" fourth edition by Larry Ullman. You can probably find a free copy somewhere.

If you've done any work with programming or scripting before it should be a breeze.

Good Luck. If you wan't to be a bro and refer me to some resources for unix sysadmin that'd be cool. I've been using debian for about a year now and im comfortable navigating and using the terminal as well as writing simple bash scripts, editing grub and fstab, automating backups, etc. if that helps you gauge where I'm at.
>>
is there a better way of chaining events/functions?

function wordObjArrMaker(sentence) {
console.log(sentence);
let text = sentence.text;
let split = sentenceSplitter(text);
let etyObjArr = addEtymology(split);
let wnObjArr = addWn(etyObjArr);

return wnObjArr;
}
>>
>>59843002
I meant to reply to your comment with this >>59843219
>>
>>59843230
add your methods as prototype to the type you get and transform to and and then do it like
return sentence.text
.mySentenceSplitter()
.myAddEtymology()
.myAddWn();
>>
All memes aside

Nodejs or PHP?
>>
>>59843536
Whatever you're more comfortable with/what suits the project best.
>>
Anyone here working with incompetent partners or team members? A guy I'm working with does everything in the most retarded way.

He loads two different versions of jQuery then gets confused when there are compatibility issues. He even fucks up basic Bootstrap syntax in favor of his own hacky bullshit. I secretly despise him.
>>
so im getting unable to stat error for my css file
>page wont load, is white
>when i open source and click on css link it shows file

i added file with
<link rel="stylesheet" type="text/css" href="css/main.css">

wtf is this shit
>>
>>59843695
Cache?
>>
>>59843737
man, im getting error in apache logs
[Tue Apr 11 19:12:16.575715 2017] [php7:error] [pid 572] [client ::1:39072] script '/.../apache/index.php' not found or unable to stat, referer: http://localhost/css/main.css

>>
>>59843695
>>59843764
you have to be at least 18 years old to use this site
>>
>>59843420
nice looks much better, thanks
>>
>>59843536
>Nodejs or PHP?

It depends on your assumptions about the server.

If you do not have administrative control of the server (for example, if it's a shared hosting account), then a node.js app is usually not feasible to deploy. PHP is more universally deployable.

A node.js web app requires the user to run a daemon continuously 24/7 to listen to the web port (usually port 80). But PHP code only runs whenever a HTTP request is received, so it doesn't require a daemon of its own -- Apache or Nginx takes care of running the daemon.

You can see this if you research shared hosting accounts. Pretty much 100% of them will offer PHP, but offering node.js is much less common.

None of this is a problem if you happen to know for a fact that everyone who will deploy the app will have full administrative control of the server. In that case, you select node.js vs PHP based on the merits of the language and/or library.
>>
>>59843695
>>59843764
post main.css
>>
>>59841995
Anything would work.

I would probably go angular with a PHP API.
>>
>>59843764
>>59843695
You should be at least 18 years old prior to posting.
>>
>>59844027
why do people still use share hosting when you can get a small vps for under 5$/m and do whatever you want with it
is it just so they don't have to handle the server administration part ?
>>
>>59843622
No, which means I'm probably that guy.

This place has methods for every possible thing so anything I write is sent back with "Use the x method".

I rarely get to code. Everything is copy and paste for the most part. Sad life. Still pays double what my old job did so oh well.
>>
Can anyone explain to me how webdevs test their stuff? Like how does one test emailing or subscription systems for example
>>
File: E06S23CSD.jpg (1MB, 1200x1600px) Image search: [Google]
E06S23CSD.jpg
1MB, 1200x1600px
>>59840446
How do I use variables from another functions without declaring them as global from outside of the function?

Probably a dumb question but google isn't helping.
>>
>>59844261
you don't.
what are you trying to do?
>>
>>59844216
For emailing, you send emails to yourself. For subscriptions, you give yourself the subscription and if you need to test expiration, you set the expire date to a past date.
>>
>>59843622
Ah I see you've inherited my ex-colleague.
Say hello for me.
>>
>>59844288
I have a function that creates a random value and stores it in a variable. Which is all in .onclick function so every time I click the DOM element it will create a new value.

 
function game() {

var gameChoice = Math.floor(Math.random() * colors.length);
gameArr.push(gameChoice);

console.log(gameArr);
}



If I try create the random value outside of the function the value will be randomly generate and stored only once and then there will be no new values. So the array will just output [1, 1, 1, 1, 1....].
>>
>>59844261
If you're using one variable across multiple functions, you should put all the functions into a single scope (if we're talking about javascript, of course).
>>
>>59844410
post a jsfiddle, I don't understand what you're trying to do.
>>
>>59843622
>He even fucks up basic Bootstrap syntax in favor of his own hacky bullshit.
Why do people do this? I just don't get it. Here's a tool that makes 99.9% of things so much easier. But no, let's fuck all of it up because someone can't read basic documentation. jfc the shit that is tolerated in this industry
>>
>>59844417
>>59844467
Actually I might've just figured it out. I forgot I'm storing my random values into a global array and I can just go from there. Thanks!
>>
>>59844410
just make your onclick call this function, have function return your value, do whatever with value
>>
>>59844174
>is it just so they don't have to handle the server administration part ?

You got it.

Shared hosting is for people whose skills are limited to: (1) uploading the PHP code via FTP, (2) unzipping it, and (3) reading the "README" file to figure out how to configure it with the right MySQL password.

The problem with VPS is that it often requires a certain breadth and depth of understanding to know how to solve problems. For example, on my last VPS, I had to do my own installs of PHP and MySQL, to get the versions that were compatible with my app. Obviously, it was a simple "apt-get", but I also needed to know that since my repository didn't have the right version of PHP, I had to set up a 3rd-party ppa to get PHP7 instead. After that, I had to do a little tweaking on file permissions in /var/www. Each problem like that has a straightforward solution, but if you sum up all the problems you're likely to encounter on a VPS, it can actually require a lot of experience to navigate them all without thinking that you've gotten yourself in over your head.
>>
File: 1395448162396.jpg (22KB, 350x300px) Image search: [Google]
1395448162396.jpg
22KB, 350x300px
>tfw i'm a software dev and there's no way getting out of it other than getting fired
>>
>>59844616
ye i used to think it was mainly a price point issue
when i see people getting their data stolen because they couldn't be arsed to set mongodb up with a password not to mention having a firewall i'm glad shared hosting is an option

>>59844629
non compete clause ?
>>
>>59844216
>Can anyone explain to me how webdevs test their stuff?
They don't.
>>
>>59844616
I am always so scared about security on vps tbqh considering ufw it's pretty much the only thing I """know"""
>>
>>59844761
>non compete clause ?
see this anal attention to detail is not something i really want to handle on a day to day basis
>>
>>59844887
wut?
>>
.post(function(req, res) {
let wordObjArr = wordObjArrMaker(req.body);
res.json(wordObjArr);
});


wordObjArrMaker is a function that involves using promises to fetch data from an api and update an array. by defining wordObjArr as a variable, does that mean that all the promises have to fulfill before res.json sends it off? Because currently res.json is sending an array with null values
>>
>>59845101
no, res.json will execute immediately.
if wordObjArrMaker returns a promise then you have to await it.
>>
Anyone ever work with d3js?
Are there any prebuilt graphs you can do with it? Like, if I supply a dataset, can it graph an XY bar/line graph? If not, is there some alternative library that would be able to do that for me?
Complete noob to javascript.
>>
hot tip: document.all gains a new life with object destructuring

document.getElementById("itemName").value = item.name;
document.getElementById("itemEnabled").checked = item.enabled;

const {itemName, itemEnabled} = document.all;
itemName.value = item.name;
itemEnabled.checked = item.enabled;


it works with <form>.elements and <fieldset>.elements too
>>
>>59845570
ChartJS
>>
>>59845570
used it once
since i was not familiar with the library i merely adapted some examples from their gallery on github
it can pretty much do whatever you want
>>
I'm using jQuery and prettify within my current project.

Is it better to host it on my server or use a cdn for it? Also if I decide to host it locally and publish the code via git, should I include those libaries?
>>
>>59845620
>>59845637
Yeah, I might just stick with d3.
Now this one is a long shot but what the hell. What's a good way of scraping data from this particular page?
http://www.imdb.com/title/tt3460252/business
I'm mainly interested in getting the Weekend Gross data for USA.
>>
>>59845761
Include them in your `package.json`, and gitignore the node_modules folder.
>>
>>59845612
but document.all is non-standard and deprecated.
>>
>>59845761
>Is it better to host it on my server or use a cdn for it?
i would host it, just make sure you use minified versions
a cdn might make pages load faster for users on other continents but whatever

>should I include those libaries?
if you use a package manager just include the config file that tells defines what libraries to donwlod, otherwise include them so people don't have to dl the right version and rename the files themselves
>>
>>59845831
i just tried it in {chrome, firefox, edge} and it worked

that's standard and non-deprecated enough for me
>>
>>59845839
I will host them, it's less of a hassle. Minified versions already in use.

It's a PHP project that only uses jQuery for some front-end stuff. So I'll include it probably.
>>
Somehow my color selection sucks ass (css). Are there any good websites other than material.io that show colors that work good together?
>>
>>59845941
https://coolors.co/app
>>
>>59845941
color.adobe.com
>>
File: 7UdJD.jpg (541KB, 1519x1100px) Image search: [Google]
7UdJD.jpg
541KB, 1519x1100px
>>59840446
Where should I start if I wanna start learning and building the back end aspects of the MEAN stack?

Also can someone red pill me on mongoDB, I can't really remember but I thought I read in the past that it's not all that great.
>>
>>59845789
just look at html file, find the nodes containing the information you are interested in
load html document using your language of choice, either use html / xml parsing library for said language or just write an xsl script to print desired output using xpath to select the nodes you identified earlier

other option would be to use any of the third party sites offering imdb data though apis
>>
Can someone give me a quick rundown on typescript?
>>
>>59846055
Sure, when it came out it had problems, but it's actually pretty decent now.
>>
>>59846263
it's type safe javascript
>>
>>59846055
You should only really use mongoDB if
a.) You have to deal with humongous amounts of data and
b.) You don't need relational model.
>>
>>59846263
Does a couple of things. Introduces types to javascript so that you can have your intellisense correct your typing mistakes. It also can serve as a pollyfill for ES6 stuff. So you can program with ES6 but it will transpile to something that will run on Explorer 9.
>>
>>59846055
mongodb is super easy, just use it with mongoose. anything you store in mongo will be an object so think of it as similar to JSON
>>
So, despite putting

Order Allow,Deny
Allow from (my ip address)

in the /usr/share/phpmyadmin folder,

other IP addresses can still access my website's phpmyadmin page. How do I prevent this senpaitachi?
>>
>>59847426
do you actually need a web based mysql administration tool?
otherwise I'd just remove it completely, it's a security hole.
>>
>>59847426
Okay, so I added

"Deny from all" in the middle of the order and the allow statements, but now even I cannot access phpmyadmin
>>
>>59847561
>do you actually need a web based mysql administration tool?

I know how to use myphpadmin and I'd rather not change my work flow. My site is up and running and I'm pretty sure I wouldn't be able to get back to where I am at the moment with the site without my current workflow.
>>
>>59847426
>>59847563

here

I couldn't figure out how to block ip addresses from accessing phpmyadmin, but I decided to rename website.com/phpmyadmin/ to a 200+ random character string like website.com/jniunjijmoi893ji.........3oij89dj/

How long do you think it would take someone to brute force it? Only security measure I feel like I can take at the moment.
>>
Anyone able to offer suggestions towards the below code? the user posts a sentence to the server, some stuff is done to the sentence, then the server res.jsons back an array where each word is an object. Everything works until it gets to the 'addWn' function which uses promises, the res.json fires before the api calls complete within addWn. I removed 'sentenceSplitter()' because it works and I ran out of space, it returns the split sentence put into word objects in an array. Thanks, all help is appreciated

router.route('/api')
.post(function(req, res) {
let wordObjArr = wordObjArrMaker(req.body);
res.json(wordObjArr);
});

function wordObjArrMaker(sentence) {
let text = sentence.text;
let split = sentenceSplitter(text);
let etyObjArr = addEtymology(split);
let wnObjArr = addWn(etyObjArr);
return wnObjArr;
};

function addEtymology(objArr) {
let newObjArr = objArr.map(function(wordObj, i) {
if (etymologies.find(e => e.word === wordObj.word)) {
let etyObj = etymologies.find(e => e.word === wordObj.word);
(etyObj.word) ? wordObj.etyword = etyObj.word : null;
(etyObj.pos) ? wordObj.pos = etyObj.pos : null;
(etyObj.crossreferences) ? wordObj.crossreferences = etyObj.crossreferences : null;
(etyObj.quotes) ? wordObj.quotes = etyObj.quotes : null;
(etyObj.etymology) ? wordObj.etymology = etyObj.etymology : null;
(etyObj.years) ? wordObj.years = etyObj.years : null;
wordObj.id = i;
return wordObj;
}
else {
wordObj.id = i;
return wordObj;
}
});
return newObjArr;
}

function addWn(objArr) {
let wnObjArr = objArr.map(function(obj, i) {
//console.log(obj);
wn.word(obj.word, {
useCanonical: true
})
.then(function(word) {
return word.etymologies()
})
.then(function(ety) {
//console.log(ety);
wnObjArr.wnetymology = ety;
})
.then(function() {
if (i == objArr.length) {
return wnObjArrl
}
})
.catch(console.error);
})
}
>>
What do I need to do to make an HTTP request include an origin header? Are they not a thing unless you're using AJAX? I'm prototyping my web app using old school page loads and forms but I'd still like to check origin headers
>>
I'm seriously confused on the syntax of exports and imports and requires and what is correct. I type something and it complains about unknown tokens or semicolons.

I just want to use rollup to combine a few files why is javascript so shit.
>>
File: heh.jpg (101KB, 588x466px) Image search: [Google]
heh.jpg
101KB, 588x466px
So yall said since pseudo styles aren't part of the DOM I can't modify it with javascript. So I found a script that can constantly add in a new pseudo style to cover up the old one. What is the consequence of this madness? setTimeout is 1 second.
>>
>>59849563
LMAO
But why so you need so many pseudo styles tho?
>>
>>59849845
I just wanted to update the pseudo style so that it functions as a load bar.
http://stackoverflow.com/questions/23569441/is-it-possible-to-apply-css-to-half-of-a-character
The bottom half of the word is another color so it looks like the word is getting filled up as it loads up. In the example the height is static at 50% so I was messing with javascript to update the height percentage every second to function as a load bar.
>>
>>59848378
I don't see the promises resolved anywhere, though.
>>
File: 1490044488258.jpg (552KB, 1625x1117px) Image search: [Google]
1490044488258.jpg
552KB, 1625x1117px
Anyone here with a Linode VPS in Frankfurt?

Can you please ping speedtest.ams01.softlayer.com
and tell me the latency?

Have a Gondola in exchange
Thanks
>>
How do I terms of service and privacy policy for my site, guys?
>>
>>59851047
Nevermind, found this website:
https://wondernetwork.com/pings
Average pings between major cities
Matches my observations +/-1 msec
>>
>>59850282
wn (wordnik-as-promised) returns promises, I have to resolve them myself?
>>
>>59842023
CSS is fine.
>>
>>59842023
JavaScript.
>>
>>59851351
>1) You have no service or privacy when you use my site.
>2) By signing this contract you agree to sell your soul to me.
Just add some big words normal people don't understand. All the big companies have this exact outline.
>>
What can /g/ recommend if I'm looking for a web host that provides:

1.) Fully managed servers
2.) Support for several languages (PHP, Node, Erlang, Clojure and possibly more)
3.) Good performance (able to handle lots of traffic if need be, fast servers)
>>
>>59852155
Based on how I understand how promises work from jQuery/ES6 promises.
>>
>>59844261
var someVar = '';
function func() {
someVar = 'foo';
}
function anotherFunc() {
someVar = 'bar';
}
>>
General question -

For web dev, how advanced did you think your math skills needed to be? Did you have to sharpen your math skills to progress?
>>
>>59844261
//closures
var logNum, incNum;
function func() {
var num = 1;
logNum = function() {console.log(num)}
incNum = function() {num++}
}
func();
incNum();
logNum();
var oldLog = logNum();
oldLog();
>>
>>59853252
>Did you have to sharpen your math skills to progress?

I work for a 400+ employee company in the bay area and I dropped out of high school. I don't think I could solve an Algebra-II level problem on paper.

I personally don't think you *need* much math skills to do web development, but that probably depends on where you want to specialize. For example, you would probably want more solid math skills if you were looking into positions that require data visualization or deal with maps or some shit.

But getting better at math won't hurt, what will really improve you as a programmer is studying stuff like algorithms, compilers, etc.
>>
>>59853252
No. You really shouldn't need any crazy math unless you're working on extremely advanced, low-level shit. Data science, machine learning and AI are obvious fields that would require an extensive background in math.

Source: I'm fucking retarded at math and have been a web dev for 5 years
>>
>>59853408
>>59853383

This is comforting to know. I'm working on getting an AA in general studies right now and had the option to pick any 2 math classes offered to finish. I'm just a little nervous.

I took a Java class in high school and it literally made me feel like a retarded piece of shit even though I aced all my other classes. I've been scared to touch programming after that but I'm interested in getting a bachelors in CS
>>
>>59844410
<button onclick="game()">Click!</button>
<div id="results></div>
<script>
var results = document.getElementById('results');
var gameArr = [];
function game() {
var gameChoice = Math.floor(Math.random() * colors.length);
gameArr.push(gameChoice);
}
console.log(gameArr);
results.innerHTML += '<div> +gameArr+ </div>'
</script>
>>
>>59853436

I think CS is a good direction to head into if you're interested in software/hardware engineering. CS programs are pretty math heavy tho.
>>
>>59845789
use cheerio
>>
>>59847426
http://stackoverflow.com/questions/2631269/how-to-secure-phpmyadmin

add this to your htaccess
Order deny,allow
Deny from all
allow from 199.166.210.1
>>
>>59846263
see
http://stackoverflow.com/questions/805168/what-is-a-strictly-typed-language
>>
Anyone here uses Sass?
>>
So how do I prevent others from accessing my website through PUTTY and other similar services?
>>
>>59854241
Sass + webpack combo here.
Before I used koala.exe to compile sass, but webpack is better.

got anything to ask?
>>
>>59854722
try searching for iptables, ufw, fail2ban

fail2ban will solve your problem
>>
>>59853252
you will only need basic math imo, unless you will go deeper into the nerdhole like advance algorithm, deep learning, and more AI stuff
>>
>>59852955
I've tried

digitalocean
host1plus
vultr
ec2

and they're ok, I don't know man just choose what works best for you
>>
I'm a bit of a novice here
I use a script called context.js that adds custom entries to the right click menu in dwb web browser.
I'm trying to find a way to use the url of the current webpage in the script.
You can use the link being clicked with "contextUri" and seperate .sh scripts that are key bound can use the current url with $DWB_URI but this variable doesn't seem to be available to the .js scripts
Is there an obvious way to have something akin to $DWB_URI like "pageUri" in context.js?

examples: https://pastebin.com/5gLyEHY8

I'm writing a shell script I want to launch on a link from context.js but the script needs the current page url.
>>
File: ss_015.png (87KB, 987x383px) Image search: [Google]
ss_015.png
87KB, 987x383px
is this photo 100% true?
>>
whats the standard way of launching your javascript shit when page is loading?
i've been doing:
<script>
PageSpecificModuleHere.Init();
</script>

but it feels a bit wonky
>>
File: senpais.png (44KB, 1311x516px) Image search: [Google]
senpais.png
44KB, 1311x516px
Try using Wicket and get this, even though I added the filter code to pom.xml, but it still give me
"Can not determine Markup. Component is not yet connected to a parent."

S-senpai(s) please help.
>>
I need take code that users write and compile it to get the result.

How would I do this?
>>
So I'm trying to teach myself Javascript and I am running into a problem with this music player.

http://codepen.io/anon/pen/bWGpYe

The button isn't working, but the documentation says my methods are correct? What do I need to change?
>>
>>59857093
It works though.
>>
>>59857227
Very strange, it doesn't work for me in codepen or a normal site.
>>
>>59857244
Well it was working. Now it just autoplays regardless.
>>
>>59857257
The autoplay is intentional. The wavesurfer.playPause() method is to play if it's paused, or pause if it's played. I just want the button to do that.
>>
>>59857244
What browser are you using?
>>
>>59857286
Chrome. The Chrome console is saying wavesurfer isn't defined.
>>
>everybody telling me .jpg is obsolete since .png replaced it
>no visible difference between jpg and png in most use cases while half the size

am I being memed?
>>
>>59857359
>everybody telling me .jpg is obsolete since .png replaced it
Literally only retards claim so. jpg and png have very different applications, especially in web dev. Just hit up your local search engine and look for application differences between the two so you know when to use one over the other.
>>
>>59857093
I fixed it and left comments as to why it wasn't working.

You're welcome
>>
>>59857292
forgot link

https://codepen.io/anon/pen/wdvWmy
>>
>>59857434
Are you sure about that? Its exactly the same for me still.
>>
>>59857449
see
>>59857448
>>
Can someone give me a simple example of PHPs glob() retrieving filenames from a folder with absolute and relative path?

I tried using the examples in the documentation but they're not working
>>
>>59857359

>what is lossy vs. lossless compression?
>what is antialiasing vs. sharp lines
>what is alpha blending?
>>
>>59857359
I use png only when there is transparency.
>>
>>59857570
<?php

$dir = "files";

// Run the recursive function

$response = scan($dir);


// This function scans the files folder recursively, and builds a large array

function scan($dir){

$files = array();

// Is there actually such a folder/file?

if(file_exists($dir)){

foreach(scandir($dir) as $f) {

if(!$f || $f[0] == '.') {
continue; // Ignore hidden files
}

if(is_dir($dir . '/' . $f)) {

// The path is a folder

$files[] = array(
"name" => $f,
"type" => "folder",
"path" => $dir . '/' . $f,
"items" => scan($dir . '/' . $f) // Recursively get the contents of the folder
);
}

else {

// It is a file

$files[] = array(
"name" => $f,
"type" => "file",
"path" => $dir . '/' . $f,
"size" => filesize($dir . '/' . $f) // Gets the size of this file
);
}
}

}

return $files;
}


// Output the directory listing as JSON

header('Content-type: application/json');

echo json_encode(array(
"name" => "files",
"type" => "folder",
"path" => $dir,
"items" => $response
));
>>
File: me.jpg (72KB, 1280x720px) Image search: [Google]
me.jpg
72KB, 1280x720px
>>59848378
>
            (etyObj.word) ? wordObj.etyword = etyObj.word : null;
(etyObj.pos) ? wordObj.pos = etyObj.pos : null;
(etyObj.crossreferences) ? wordObj.crossreferences = etyObj.crossreferences : null;
(etyObj.quotes) ? wordObj.quotes = etyObj.quotes : null;
(etyObj.etymology) ? wordObj.etymology = etyObj.etymology : null;
(etyObj.years) ? wordObj.years = etyObj.years : null;
>>
File: react-native.png (24KB, 1024x631px) Image search: [Google]
react-native.png
24KB, 1024x631px
Is it possible to write an Android keyboard using React Native? I mean a keyboard that can be used system wide as an input method, not just in inside it's own app
>>
why are people so against switch statements? theyre faster alot of the time...
>>
>>59846263
i find it useful but i hate it

vs code has great integration for it (with intellisense and everything) which makes moving onto alternatives harder

working with dom stuff is a pain

you have to cast results from document.querySelector and friends unless you're fine with them being just (HTML)Element

the type definitions aren't always correct or updated (the format they use to generate the dom type declarations is undocumented so good luck contributing to them after signing the CLA of course)

the types for xml documents and elements are broken as a way of "fixing" html ones
>>
>>59857784
personal preference

>theyre faster
wow great job saving that fraction of a millisecond

i used to be into pointless micro-optimizations too until i realized it doesn't fucking matter and started focusing on readability instead
>>
micro-optimizations !== optimizations

thinking about the performance of different conditional/loop styles is a waste of time

fixing your program's logic is what you should be doing for optimization
>>
>>59857817

Youre retarded. Those fractions of a millisecond add up. Do you realize every single day people are working on something to get x job done (((faster)))? Why do you think Big O notation is important?
>>
>>59857870
They really don't.

Good compilers optimize most of that stuff anyways, so it really doesn't matter in either sense.

This is really a silly argument on both sides
>>
>>59857870
kys
>>
>>59857850
>>59857908
>>59857920

something tells me youve only done front end babby javascript instead of write applications that actually do heavy lifting and read from different servers and folders. If you don't think big o notation comes in handy with that then please kys
>>
>>59857710
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
>>
>>59858019
but why abuse it in statement context like that when if exists

do you also eat cereal with a shovel

if (etyObj.word) wordObj.etyword = etyObj.word;
if (etyObj.pos) wordObj.pos = etyObj.pos;
if (etyObj.crossreferences) wordObj.crossreferences = etyObj.crossreferences;
if (etyObj.quotes) wordObj.quotes = etyObj.quotes;
if (etyObj.etymology) wordObj.etymology = etyObj.etymology;
if (etyObj.years) wordObj.years = etyObj.years;


this does the same thing except without the meaningless
else { null; }
branches
>>
stupid people should be killed
>>
>>59857850

This.


>>59857870
>>59857908
>>59857974

You're missing the point.
"PREMATURE optimizations is the root of all evil".

First you build something, then you tackle the bottlenecks until it runs reasonably fast.


If your network slows you down 100x, there's no use in fiddling with minor syntax issues beacuse "muh prescious CPU cycles".

IF you found out your bottleneck really is a certain function AND you really need to optimize the shit out of it AND you've tried your best with differnt libraries AND you've done all you can in terms of refactoring/rewriting the code, finding different algorithms and so on.. THEN you might think about nonsense like CPU cycles of switch vs. nested if statements..
>>
>>59858087
This. That's basically common sense, but people seems to miss the point all the time. No, your "optimization" technique will comeback later and bite you in the dick
>>
>>59857681
Thanks, I guess i'll use this instead of glob then
>>
>>59848378
what is wn.word ?
If it's a promise we're going to need to work with that async code to get things in the order you want them
>>
File: b55.jpg (266KB, 1024x768px) Image search: [Google]
b55.jpg
266KB, 1024x768px
>>59858082
>>
>>59858229
no problem
>>
File: dhjdyj5.jpg (44KB, 451x392px) Image search: [Google]
dhjdyj5.jpg
44KB, 451x392px
>>59848378

>the state of javascript
>>
>>59858409
you can write shitty code in lisp and haskell too
>>
If I want to program something in Node.js should I use UNIX?
>>
noob question but i have a form that submits data, if i display none some of those inputs would it still submit the data from those inputs?
>>
File: ss_016.png (83KB, 979x698px) Image search: [Google]
ss_016.png
83KB, 979x698px
>>59858682
>if i display none some of those inputs would it still submit the data from those inputs?
i dont rly understand what are you trying to ask

i wanna know if this is how should i call function inside __construct, cant test it right now because i have to add more code, just want to know if im on right way
>>
>>59858682
yes, unless the inputs are set to disabled.
>>
Is this a good learning route?
html -> css -> js -> php
>>
>>59858817
html -> css -> php
for js google, fuck that gayshit
>>
>>59858817
i think so

>>59858860
>for js google, fuck that gayshit
i dont understand why you would say this
>>
>>59857769
I'm 99% sure you cant
>>
>>59858817
Let me get you started with everything you need to know about html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document (Goes in the tab of browser)</title>

Import your javascript
<script src="path/to.js" type="text/javascript"></script>

Import your css
<link rel="stylesheet" href="path/to.cs">
</head>

<body>
Content of the document......
</body>

</html>


<div>
: this is an element, the div element.

<div class="my-class-name another-class-name">
: this is a div element with a class attribute

Bam, you now know html
>>
>>59858817
Now let's learn you everything you need to know about css
http://getbootstrap.org

Here's a css library you can use (that everyone uses). You shouldn't have to touch any css as long as you don't want anything crazy custom. Just use their classes and examples

To include it into your project, just download it and on your line where you said this:
<link rel="stylesheet" href="path/to.cs">

just link "path/to.cs" to "bootstrap.css" like this
<link rel="stylesheet" href="path/somewhere/bootstrap.css">




If you really want to write your own styles, make a file with a .css extension and link it into your html like you did with bootstrap.css. You'll include it just below your bootstrap import so it will look like this:
<link rel="stylesheet" href="path/somewhere/bootstrap.css">
<link rel="stylesheet" href="path/somewhere/myCustomSheet.css">


In that file you can define your own custom classes like this:
https://www.w3schools.com/html/html_classes.asp

But I recommend you touch CSS as little as possible because no one understands it, it's not intuitive, and it's absolutely disgusting to work with. Just use Bootstrap, they've figured out all browser compatibility issues, handled how it scales on different screen sizes, and it has everything you need.

Bam, you now know css
>>
i have a finished game written in js, but im gonna migrate from a shitty console ui to a react based one
how do i integrate existing components into react?
would the following work and update correctly whenever something inside the game instance changes? (i.e. health changes or something)

class GameUiComponent extends React.Component
{
constructor(game: Game)
{
this.state = {
game = game;
}
}

render()
{
// code
}
}
>>
>>59858817
Now JS/PHP is the tricky one. The other two are trivial, don't even put them on your resume because it's something that can be understood in 10 seconds. Whether you focus more on PHP or JS is determined by what kind of application you want to make, what kind of job you want. You want more job security or more pay?
>>
>>59859328

i use both js and php on the app im making now

doesnt really matter what back end you use, the 2 do completely different things unless youre using node which you wouldnt really need php
>>
>>59859384
I mean he could just learn PHP and be fine, but if he learns JS, he's also going to need some PHP. If he's looking for minimal learning and max job security he should just learn PHP. Otherwise both
>>
in raw javascript ajax request, how do i send some raw text to the server? i can do it if its form data but what if its not
>>
>>59859411
post what you got kid
>>
>>59859419

function deleteCurrentItem(id)
{
if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
xmlhttp.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
successMessage("Item deleted successfully.");
//load current data
}
else if (this.status == 404)
{
errorMessage("Could not delete this item. Contact Chris.");
}
}
xmlhttp.open("POST", "deleteItem.php?itemId=" + id, true);
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send();
}


so uhh yeah...trying to get the id thats passed through this function sent to the server where i can store it in a variable called itemId or something.
>>
>>59859464
you usually use url request parameters for get requests and put data in request body for post / put / patch requests

use xmlhttp.send(id);
>>
>>59859464
You seen this? http://stackoverflow.com/questions/23021631/how-to-send-a-string-to-php-with-post

basically put the string in your send() call
>>
>>59859548

how do i get the id on my back end? $itemId = $_POST['id'] doesnt work
>>
>>59859596
checked your form method?
>>
>>59859749

im not getting the id from the form tho
>>
How is Eloquent JavaScript?
>>
>>59859761
so value is showed in url?
Can you post your url?
did you tried just to echo $_POST['id'];?
>>
>>59859778

ya i tried to echo that and i got nothing

function deleteCurrentItem(id)
{
var str = "itemId=" + encodeURIComponent(id);
if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
xmlhttp.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
successMessage("Item deleted successfully.");
//load current data
}
else if (this.status == 404)
{
errorMessage("Could not delete this item. Contact Chris.");
}
}
xmlhttp.open("POST", "deleteItem.php", true);
xmlhttp.send(str);
}
>>
>>59859821
you have nothing in url, it is just deleteItem.php, no ?id=
>>
>>59859849

i changed it to

    xmlhttp.open("POST", "deleteItem.php?id=" + str, true);



still didnt work
>>
>>59859821
>http://stackoverflow.com/questions/8945879/how-to-get-body-of-a-post-in-php
$entityBody = file_get_contents('php://input');
>>
I'm so fucking sick and tired of working with CSS on my own. Its so fucking unintuitive and positioning things that are 3 or 4 divs in is a fucking nightmare.

Are there any good resources for getting started with Bootstrap?
>>
>>59859821
>still using the word function
>brackets underneath

disgusting
>>
>>59859890
just look at their doc, it's easy
>>
>>59859890
CSS is such shit.

Someone needs to design a drag-and-drop CSS creator that let's you specify mobile locations too.

Basically like a Dreamweaver that uses grid.
>>
>>59859890
I think it's pretty simple.
What problems do you have with it?
>>
>>59859974
Bootstrap is so bare bones and minimalistic and flat and so if you want your site to not look like complete shit, you're inevitably forced to try to work in your own CSS alongside Bootstrap which is fucky at best.

CSS just needs to be scrapped entirely and started over.
>>
Hello friends, I'm kind of a newfag here, mostly /v/ and /tv/. I've been learning code by myself for about 6-8 months, using the OP's websites and some books I've bought.

I think I've got a decent handle on Java, python, and a little bit of azure (a friend of mine lent me a book). I think I'm alright at it. However, I didn't go into post-secondary for programming or any sort of computer related topics. My degree is in philosophy and math.

If I wanted to work in some facet of programming or computers, with my limited knowledge, and having no certification that proves I'm capable other than my word, how likely would I be to get hired? Should I just give up on this venture?
>>
>>59860152
Just create an online portfolio with all of your sites/programs and whatever else you think an employer might care about and use that. It's that simple really. A degree or certification helps though.
>>
>>59860049
i prefer foundation so maybe give that a shot if you're still interested
>>
>>59860171
Yeah, this is kind of what I feared. As my brother went into architecture for his post-secondary, he had to prepare a portfolio as well.

But the issue is, I don't really have any sort of testimonials or significant programs/sites that I could put in. All I have is my girlfriend and 2 of her friend's tumblrs, a couple of programs I shared on a vidja emulator forum a while back to help some guy get some grinding done,. I don't really have any sort of opportunity to show my experience or lack there-of. I'd be gladly willing to do some stuff but I wouldn't even know where to look.
>>
anyone know how to send plain text to a server via raw javascript/ajax POST request?
>>
>>59860281
You don't have to work on actual things for real people to include it in your portfolio.

I am a front-end web designer. My online portfolio itself was something they could judge me by. I also included some sites I had created for fake businesses, and even redesigned some already existing popular sites.

You don't have to actually be paid by someone for an interviewer to think your work is good. Pick one thing you want to get really good at, get good at it, then come up with ways to showcase that talent in a relevant manner, be it mock sites or whatever.
>>
>>59860308

This is discussed literally 10 posts or so back. Scroll up a bit.
>>
>>59860333
damn. I'm retarded. This seemed so logical but I didn't even arrive at it. Do you know what certifications I could get? I'm not really too interested in going back into school, maybe a CC but that's as far as it goes. I live in NA if that makes it any easier.
>>
im getting
 A non well formed numeric value encountered 


and error line is
        $this->OLD_BIT_RATE %=1000;



Value of $OLD_BIT_RATE is something like 1011146
>>
>>59860380
I don't know dude, I have literally zero idea what you are interested in. Just go on Google and search "[what job you want] certification" and see what you find.
>>
>>59860337

when i try to post the data tho nothing shows up is it because its not part of a form?
>>
>>59860337

ya this doesnt answer my question at all its just a variable that sores a number i want to send to the server then store that in a php variable. None of the above code works
>>
>>59860413
Yeah sorry about that. the onus is on me to specialize. Might I ask how numerous or extensive your portfolio was for your web-design appeal, unless it's too personal?
>>
>>59859849

it didnt work

anyone know how to send a raw variable to a phph variable via POST request ajax?
>>
>>59860709
the javascript in >>59859821 and the php in >>59859596 look like they should work to me

you might be doing something else wrong
>>
>>59842023

>CssIsAwesome
>CIA

they're everywhere...
>>
>>59860832

nah that code doesnt work. the PHP doesnt recognize whas being sent. I cant store it in a variable or anything
>>
anyone know how to pass a javascript variable through a function and send it to the server to use server side through a ajax POST request with raw javascript?
>>
>>59860997
i think i found the bug:

you're sending it to php as "itemId" but checking "id" in php

>>59861095
stop spamming retard
>>
>>59861095
const xhr = new XMLHttpRequest();
xhr.open('POST', 'target');
xhr.send('faggot');
>>
>>59861109

still didnt work
>>
>>59861309
i promise it'll work now if you put this after xmlhttp.open:

xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");


it's required when POSTing data in the "key=value" format

i hate how hard to remember it is and i have to google "form urlencoded content type" every time
>>
>>59861438

nah man still doesnt work ive tried everything

function deleteCurrentItem(id)
{
var str = "itemId=" + encodeURIComponent(id);
if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
xmlhttp.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
successMessage("Item deleted successfully.");
//load current data
}
else if (this.status == 404)
{
errorMessage("Could not delete this item. Contact Chris.");
}
}
xmlhttp.open("POST", "deleteItem.php?itemId=" + str, true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(str);
}


then in my php file i have

    $itemId = $_POST['itemId'];
echo $itemId;


doesnt echo anything. Is this even possible
>>
>>59861438

this does nothing since the data isnt coming from a form
>>
>>59861508
>doesnt echo anything
it echoes it to the response of
xmlhttp


you can check
xmlhttp.responseText
in the
//load current data
part
>>
>>59861523
spreading misinformation is punishable by law

you have been reported to the authorities
>>
>>59861551

no cuz im going straight to the url it should display the variable ive done this before with form data but since this isnt form data its fucking up
>>
I'm trying to build up a backend web dev portfolio. What kind of personal projects are noteworthy enough to go on that?

Right now I'm thinking of a site that takes a youtube video url and gives you a download of the audio. Is it ok to use a library off github to do that, or should I make my own library? Because I've tried to make my own library of it and I ran into problems on a lack on understanding youtube's internal api.
>>
File: anonphp.png (76KB, 1316x851px) Image search: [Google]
anonphp.png
76KB, 1316x851px
>>59861508
it works, seems like you fucked up somewhere else.
>>
>>59861575
>im going straight to the url it should display the variable
navigating to deleteItem.php (like from a link or typing it in the address bar) sends a new GET request without any data, and displays whatever that php file echoes as a webpage

submitting a form like <form method="POST" action="something.php"> sends a new POST request (with data from form inputs) to the php script, and displays whatever that php file echoes as a webpage

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form

what do you want to do with the output from deleteItem.php?
>>
>>59861642
>>59861673

it works now thanks a lot. When i tried to print_r it said there was just an empty array, but then i tried biding to to my query and the query worked fine. So $itemId = $_POST['itemId'] really is getting the id thats passed through the function. I just couldn't tell it was there....

fuck. That was confusing
>>
>>59861673

i was just trying to output the $itemId variable to make sure the server was getting it. All deleteItem.php does it bind the $itemId variable in a pdo query
>>
>>59861766

also i didnt need to change the URL. It still works if i just have "deleteItem.php". No need for the "?itemId=" + str.

Final working code:

function deleteCurrentItem(id)
{
var str = "itemId=" + encodeURIComponent(id);
if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
xmlhttp.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
successMessage("Item deleted successfully.");
}
else if (this.status == 404)
{
errorMessage("Could not delete this item. Contact Chris.");
}
}
xmlhttp.open("POST", "deleteItem.php", true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(str);
}


thanks brehs
>>
File: feel crying.jpg (68KB, 700x700px) Image search: [Google]
feel crying.jpg
68KB, 700x700px
When will the shit heap known as Javascript die already?

They've had over 20 years to get their shit together, but it's still as unstable as ever. No amount of turd polishing such as Typescript is enough to fix it.

When will there be an actually good JS replacement?
>>
>>59861878
that sounds like something someone who's bad at javascript would say

there are free tutorials for it on the internet if you didn't know
>>
>>59861874

wow i didnt even need to create a "str" variable either, or encode the parameter

NEW final working code:

function deleteCurrentItem(id)
{
if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
xmlhttp.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
successMessage("Item deleted successfully.");
}
else if (this.status == 404)
{
errorMessage("Could not delete this item. Contact Chris.");
}
}
xmlhttp.open("POST", "deleteItem.php", true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send("itemId=" + id);
}
>>
>>59861944
why are you checking for xmlhttprequest existence, but not providing an alternative if it doesn't?
if it doesn't exist it'll fail regardless.
>>
>>59860425
>>59860473

You just build the data that you want to send, post the data using XMLHttpRequest and pick it up via $_POST.
>>
skipping the check for xmlhttprequest is fine unless you're going to run it on museum computers
>>
Look, here's a fiddle with some stuff: https://jsfiddle.net/dp0coLa3

That POST request is being received happily.
>>
>>59861992

ya i know, i never sent data before without using a form, its a little different
>>
>>59861942

>loose typing
>bloated
>no truly stable frameworks
>each browser has its own implementation

Tell me again why it's good?
>>
>>59862218

Ah, okay. Just as an aside, if you're willing to jQuery you can serialize a form easily with $('form').serialize( );
>>
>>59862235

It's ubiquitous and has the potential to be very expressive, provided you avoid the shitty aspects of it.
>>
>>59862235
why do cars exist
>have to be refueled
>more expensive than walking
>loud
>can cause accidents
>>
>>59862255

ya thats ive been doing

>>59861962

ya idk why i was doing that, fixed it

thanks all
>>
Is Jquery shit and not worth learning in 201x?
>>
>>59862606
>learning jquery
it's just some javascript helper functions, there's not much to learn.
use them to make your life easier if you want.
>>
>>59862652
Yep. I don't know why people are still treating jq as some entirely separate and complex system.
I guess that's just what happens when people don't actually look into things themselves and instead just rely on meme opinions.

>>59862235
>shitposts constantly
>always needs food
>unstable as fuck
>bloated
>can't be understood by anybody
Tell me again why you exist?
>>
File: 83794.jpg (64KB, 612x612px) Image search: [Google]
83794.jpg
64KB, 612x612px
Damn why php is so hard/shit to install on windows, osx and linux.
Composer is so shit that I have to add its path to the system path and create symlink for each global package. Holy shit why node and golang ecosystems are so easy to use compare to php, java, ruby or c#?
>>
>>59863269
https://duckduckgo.com/?q=xampp
>>
>>59863301
I don't need all these bloated shits!
>>
File: 1458447318959.png (404KB, 1200x633px) Image search: [Google]
1458447318959.png
404KB, 1200x633px
Welp, I just got an offer for a Contract position for a Technical Front-End Dev while my freelancing career imploded in the span of an afternoon. Ask me anything while I cry and ask myself why I suck so much at this. /blog
>>
>>59863353
What did you do senpai?
>>
>>59863365
I underbid on a project that was way too much for me at the time and I was unprepared for. I went in like an idiot because I needed the money, but trying to build something from scratch with little to no help was a fucking stupid idea.. It's a "Kickstarter/Shark Tank" but for small to medium sized businesses. and trying to do everything on my own just bit me in the ass, especially for $1500 total. I've been working on it since November last year, and frankly, I don't have the patience or dedication for the last $200 since the guy asked to incorporate PayPal Express Checkout when I've already incorporated Stripe throwing everything out of whack. It didn't help that I got no real input on what to do and how to design things unless it was an obvious fuckup on my part. If I went back in the past, I would probably have picked something way smaller as a starting project or just worked Help Desk. I learned a shit-load of Python though, so it wasn't all a massive fuckup. All I know is that I pray to something that I can get this Junior position, otherwise, the last year was a total waste of everyone's time and effort.
>>
>>59863529
this experience in entrepreneurship made you way more valuable to employers
just describe your experience slightly less critical than as you just did, highlight what you've learnt and you're gucci
>>
>>59863269

>compare to php, java, ruby or c#?

Hmm?

PHP yes, I'll give you that.
Just use something like XAMPP, it's not worth putting to much effort in it.

But the rest?
>java
1) Set PATH and CLASSPATHS correctly.
2) Never face any problems.

>ruby
Ruby Gems are a breeze, and even if you bother to use RVM, it's not really difficult. Deployment is not as smooth as PHP or Java, but the rest is super nice.
(OK at least for Mac or Linux, for Wangblows you have to configure two more things correctly..)

>C#
On Win: A breeze
On Linux: Avoid
>>
https://www.right2work.net/

Some of you might want to check this out for job opportunities
>>
>>59863529

Hahaha... are you me?

That sounds exactly like my first bigger web project:
>Yeah, bite more than you can chew!
>Just look at the money!
>Nah, I'm doing this myself, who needs help anyway?
>What am I doing with my time anyway? Let's spend half a year with some selfmade clusterfuck under pressure!
>Scope creep - why yes? Of course I can implement the 674th feature we never talked about earlier!
>And who needs time management or meetings? Those things are so overrated..

Goddamn.
I've learned my lesson and I learned it well.
>>
>>59840446
Does /g/ only use flex for positioning?
Theres so much legacy shit in css I dont even know which one I should use.
>>
>>59863269
I'm not even sure what it is that you're complaining about. That Composer doesn't automatically add itself and binary packages to $PATH?
>>
I'm sending raw 32 bit float WAV PCM data at 44100hz to a webpage via websockets and I need to play that audio. I'm trying to figure out that arraybuffer -> audiobuffer deal, what do I do?
>>
>>59860049
Nah, it just needs to be drag and drop. Fuck designers anyways.
>>
You new freelancers, when you quote think of the max possible time, then double it. Then charge 1.5x your rate.
>>
Is there a way to change the content of a div using onclick with only CSS? I have a box, with a picture and some information, and when I click that picture, I want the information inside the div to change to change.

<div id="places">
<div id="header">Header</div>
<a href="#"><img src="/images/image.png"></a>
Content I want to change on click
</div>


Google isn't giving me anything helpful.
>>
Does anyone use angular?
>>
>>59866347
Also I forgot to mention I want it to be a toggle so you can change back and forth.
>>
>>59866379
Probably. Facebook was made in pure CSS and it's way more complicated. Toggles should be easy.
>>
>>59866236
I usually finish before i think I'll finish though. Also a tip in negotiation: Ask for an unreasonable price then drop it to a slightly unreasonable price, most of em will agree
>>
File: tegaki.png (7KB, 400x400px) Image search: [Google]
tegaki.png
7KB, 400x400px
I want to have the outermost container of my page have
flex-direction: column
and the top container of my page (the two sections) have
flex-direction: row
, but the shits keep stacking on top of each other. This happens when I limit their size too. I can't use float.
>>
File: can you feel the freedum.jpg (712KB, 1920x1200px) Image search: [Google]
can you feel the freedum.jpg
712KB, 1920x1200px
>>59866378

the startup I work at uses angular in its production code and we have a new version coming out that's in Angular 2

I just got tacked on to start learning/implementing Angular 2 for the new version.
>>
>>59866657
Nice. I want an angular job. Is it comfy?

I work with PHP and it's not comfy because anything you need to do has a method so there is hardly any coding.
>>
>>59866747
>Nice. I want an angular job. Is it comfy?

I love it. it's very powerful and allows for a lot of really cool shit. The data model driving the pages is amazing when done correctly.

The upgrade from Angular to Angular 2 involves relearning a lot of shit because they use typescript which is also pretty damn cool and useful. Though I am a rookie so I get hung up on basic shit like Observables, maps, filters, subscriptions and other shit.
>>
Is Silicon Valley like the MIT for devs? If that makes sense...

I'm looking at jobs there and everything is full stack LAMP MEAN with C++ and machine learning.
>>
Console on this script is giving me
Uncaught SyntaxError: missing ) after argument list
on this tiny script.

<script>
$( "#placesbnet" ).click(function() {
$( "#placesbnet" ).replaceWith( "<div id="placesbnet2">BTag#11406</div>" );
});
</script>


I've been looking at this for like 30 minutes and I have no idea where I am missing a )
>>
>>59866945
>
"<div id="placesbnet2">BTag#11406</div>"

do you not use syntax highlighting?
>>
>>59866945
double parens? how about "<div id='...'>" instead of "<div id="places...">"
>>
File: pGJoq8M.jpg (332KB, 2048x1534px) Image search: [Google]
pGJoq8M.jpg
332KB, 2048x1534px
I want to use the github API to embed some stuff from my repo as plain text on my website. If I update the repo, I don't want to have to change the code in two places, so no gist embeds.

It looks like I can only display things from my repo 60 times per hour before hitting the API limit. This is pretty low, but if I do it authenticatedly, I can do it 5,000 times per hour.

I've only done front end work so far + made 1 practice API with node/express. So I've been reading up on how to make a back end that can:

1) schedule a cron job to every several minutes authenticatedly use the GitHub API to get and cache the relevant files from my repo
2) store them somehow (Redis? Plain js? Database?)
2) build an API to let my page getJSON the text into a div from the cached store


When I deploy this, can I just put the plain node.js files and etc on heroku or AWS or something or are there some security steps I need to take? Do I need to do something to make sure the cron job is "on" all the time? If my cache happens to be updating when I getJSON will it crash/go crazy?

pls halp
>>
File: 744808main_pia14944-full_full.jpg (66KB, 1001x1001px) Image search: [Google]
744808main_pia14944-full_full.jpg
66KB, 1001x1001px
Whats a good way to scrape whois feilds into variables?

I'm using php. I'm thinking about echoing a shellexec whois query and foreach'ing regex captured newlines into variables.
Seems like theres a cleaner way of doing this.
>>
If something works in Codepen, but when you insert the specific elements into your full HTML/CSS files it stops working, what does that usually indicate? I've got a Codepen working perfectly fine, but when I try to implement it on my site, it just doesn't work at all. No errors or anything, it just doesn't do anything at all.
>>
>>59859765

It's fantastic.

That and You Don't Know JS are the top two vanilla JavaScript resource books, IMO.
>>
>>59867106
An older entry in your CSS is either overriding key value pairs in one of your new entries, or your new CSS is overriding and breaking your old shit.
>>
>>59866996
There are PHP libraries for this
>>
>>59867147
Can you take a look at my source code for me and see what the issue might be? https://kemonomimi.neocities.org/

I'm working on a basic info/landing page for my friend. Basically, she wants the Discord and Battle.net divs to be replaced by essentially a blank div with her tags for those services, since obviously you can't link to a profile for them.

I've gotten something to work without any CSS in this Codepen. http://codepen.io/anon/pen/JNjZme However, when used in my actual index file, literally nothing happens upon clicking the same div.

(I copied the #places style, and applied it to the #bnetplaces style in style.css)
>>
why the fuck do people use bootstrap themes on wordpress?
>>
File: oh no.jpg (3KB, 125x125px) Image search: [Google]
oh no.jpg
3KB, 125x125px
is there a way in asp to increment a server side script based on the current iteration of a javascript loop?

basically, i'm trying to make Rows[0] be Rows[i] from the js loop

var data = [];
for (var i = 0; i < <%=data.Table.Rows.Count%>; i++) {
data[i] = {
LastName: "<%=data.Table.Rows[0].ItemArray[0].ToString()%>",
FirstName: "<%=data.Table.Rows[0].ItemArray[1].ToString()%>",
MiddleInitial: "<%=data.Table.Rows[0].ItemArray[2].ToString()%>",
Phone: "<%=data.Table.Rows[0].ItemArray[3].ToString()%>",
Email: "<%=data.Table.Rows[0].ItemArray[4].ToString()%>",
GPA: "<%=data.Table.Rows[0].ItemArray[5].ToString()%>"
};
}


or am i just coming at this the wrong way
>>
>>59867541
with asp.net btw
>>
>>59867541
nevermind. i'm retard and just realized this server scripting only runs on compile.


just gonna blow my brains out instead
>>
>>59866985
wat
>>
Does anyone know of a profiling for javascript? I want to be able to time the entire thing and get an indepth analysis. The built-in browser tools are OK but for some sections I find myself needing more detail within a certain function.
>>
File: 1418527738678.gif (32KB, 250x250px) Image search: [Google]
1418527738678.gif
32KB, 250x250px
>>59840446
I work as a junior Full Stack Memevelper and I make about 77k a year in Arizona. 1 year of industry experience and have a software degree from a state uni.
Today I had my first head hunter reach out to me and I've requested to learn more about the position. It says "Full Stack Intermediate Developer", what's a fair wage for a position with that title?

I want to be difficult with them when negotiating salary because 77k a year is comfy and I need at the very least 10k more for it to be worth the hassle.
>>
File: 1283603155639.jpg (13KB, 474x351px) Image search: [Google]
1283603155639.jpg
13KB, 474x351px
Finally, my 3 months old site is starting to get visitors.
The weeks before I got like 0,2 human visitors a day (+ hundreds of bots).
Today I looked and I saw 7 human visitors this morning (+hundreds of bots).

It's finally going somewhere. Soon I'm going to be rich! Rich!
>>
>>59862606
You can "learn" jquery in like an hour
>>
Will I ever get a job if I have to google shit for the correct syntax? Assume for the sake of argument that I know what needs to be done on a logical level, but I struggle with remembering where a bracket goes or something like that
>>
>>59868507
This sounds like something you should fix.
>>
>>59868507
Nope, you're fucked retard. Maybe try to stop being such a fucking idiot if you want to get a job outside of Best Buy.
>>
>>59858940
That's what I was afraid of
>>
For shitting out a nice quick portfolio wix vs squarespace?
>>
>>59869782
some alternatives:
- bootstrap premade portfolio templates
- launchaco
>>
Do you use debuger for your php code?
How do you use debuger?
>>
>>59840446
any cheapo SSD VPS with:

>10 Gbps speeds
>20 GB or more SSD storage.
>below 5 ameribucks a month, yearly plan preferably

don't care about ram or cpu, just need to upload as fast as possible.
>>
>>59866985
you need to set an oauth client up, look at a library in your server framework of choice to do this and check github's guides on how to register and get client credentials
you can cache the files in whatever, your own filesystem, mongo, your preferred rdms....
redis is good if you are worried about perfs and want a persistant caching layer, not as a general purpose db
building an api is bsic shit, why do you even need help with this

regarding he cache question you'll get inconsistent responses if you don't use an acid compliant db (mongo) and don't handle transactionnal integrity on the appliction level
shouldn't crash tho, just fetch inconsistent data
>>
File: 1487851018909.png (783KB, 712x720px) Image search: [Google]
1487851018909.png
783KB, 712x720px
what are your personal "must haves" for front end shit? (like sass, jquery, react, babel, etc)
>>
Stupid question that has been answered hundreds of times:
Books to get learn and get into the nodejs meme? I don't know javascript.
>>
>>59870200
lowendtalk.com

yearly: virmach.com/special-offers/
Thread posts: 313
Thread images: 30


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