[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: 316
Thread images: 41

File: 1501587041865.png (731KB, 824x553px) Image search: [Google]
1501587041865.png
731KB, 824x553px
the OP image shows jQuery code edition

>Getting started
Get a good understanding of HTML, CSS and JavaScript.
MDN web docs offer a good intro (independent of your browser choice)
https://developer.mozilla.org/en-US/docs/Learn

>Free online courses
https://www.codecademy.com/
https://www.freecodecamp.com/
http://www.coderbyte.com/
https://www.bento.io/

>Next
https://www.youtube.com/watch?v=sBzRwzY7G-k
https://github.com/kamranahmedse/developer-roadmap

>Useful resources
https://developer.mozilla.org/en-US/docs/Web - General documentation for HTML, CSS & JavaScript
https://stackoverflow.com/ - Developers asking questions and helping each other
https://caniuse.com/ - Check browser support for front-end web technologies

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

>in-depth comparison of VPS hosts
https://www.webstack.de/blog/e/cloud-hosting-provider-comparison-2017/
>>
Redpill me on Mongoose and MongoDB
>>
>>61689176
MongoDB is better than MySQL
>>
Redpill me on Meteor.js
>>
>>61689264
It's good. Use it.
>>
I will now share a set of names I have thought of for Javascript libraries:

Unicorn.js
Redpill.js
BrickABrack
NoJS
Lampshade
Clamshell
Headgear
Fridge
Computer
Window
>>
>>61689293
Pajeet.js
>>
redpill me on HTML
>>
>>61689317
It's shit, don't bother with it. Can't make Wordpress with it or nothin
>>
File: astonmartin_vanquish_1.jpg (86KB, 564x492px) Image search: [Google]
astonmartin_vanquish_1.jpg
86KB, 564x492px
I've read this guide on Mongoose and MongoDB. The tutorial uses a cloud-based database whereas I want to set up a local one instead. The instructions it gives to me is simply this:
Note: If you prefer you can set up a MongoDb database locally by downloading and installing the appropriate binaries for your system. The rest of the instructions in this article would be similar, except for the database URL you would specify when connecting.


Can anyone help me make sense of what I have to do in clearer terms? Maybe provide me a step by step.

The article I'm referring to: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/mongoose#Mongoose_primer
>>
>>61689405
Go download and install mongodb for your operating system. When referring to the database, the url will be localhost or 127.0.0.1 or something.

are you one of these idiot bootcamp boys I've been hearing so much about?
>>
>>61689427
What was the point of the second part of your post? Keep your personal problems to yourself.
>>
wow wdg is really a peace of shit
>>
>>61689436
Sorry to upset you sir, I just thought that maybe an emotionally intelligent adult such as yourself might be able to download and install software without reaching out to /g/ for help.
>>
>>61689427
Anyway you didn't really help me out much.
>the url will be localhost or 127.0.0.1 or something.
Can you provide something more specific? How does it work? Why is my localhost the reference to my database?

>>61689438
>wow wdg is really a peace of shit
>peace of shit
>peace
Quality man right here.
>>
What do you guys think about Laravel?
>>
>>61689447
So asking for help is against your own terms? You're not making much sense.
>>
>>61689438
wdg is thread of peace and Stallman is its prophet
>>
>>61689438
It's morning in Europe, Americans are asleep, we were just shitposting to get the thread moving.
>>
>>61689451

In your example, the mongodb server is hosted remotely (mlab, for example), so you connect to that remote db by using it's URI ex:

"uri": "mongodb://<username>:<password>@xxxx.mlab.com:21182/<db>"

In the case you want to host your db yourself, you will be having to point mongoose to your local pc (localhost) or (127.0.0.1) where you will be hosting the mongodb server:

"uri": "mongodb://<username>:<password>@127.0.0.1: 27017/<db>"

So you need to install the mongodb package, install it, en configure user, password, port and db.
>>
>>61689247
Assuming the rest of the code is correct, why doesn't this update work? Have created the objects before and assigned the properties.

 collection.update(query, {$set: plupdate}, {$set: update} 
>>
>>61689451
ok

127.0.0.1 is what's known as a loopback ip address, which refers to your own computer.
You could even say it loops back!

localhost is a machine-specific dns record, pointing to 127.0.0.1

DNS or Domain Name system is a world wide web system which stores names and IP addresses. It helps us get around the internet without plugging in IP addresses.

When you install MongoDB and you need a URL (Universal Resource Locator!) to refer to it, you can refer to
1. Your machine with localhost or 127.0.0.1
2. Your MongoDB via a secondary number, known as a port number

the url may in the end look something like this!
> localhost:27017

Let me know if you have any more questions you fucking moron. Please end your life I seriously hope you did not "graduate" whatever "Educational Institution" you "attended" without finding out what an IP address or DNS record is.
>>
Which is faster, getElementByClassName() or querySelectorAll()?
>>
File: nicjvh939irx.jpg (79KB, 1024x768px) Image search: [Google]
nicjvh939irx.jpg
79KB, 1024x768px
>>61689663
>Let me know if you have any more questions you fucking moron. Please end your life I seriously hope you did not "graduate" whatever "Educational Institution" you "attended" without finding out what an IP address or DNS record is.
>>
File: shitcoins3.jpg (212KB, 1142x986px) Image search: [Google]
shitcoins3.jpg
212KB, 1142x986px
Day #2 of my comfy alt-coin trading bot. Working on the ui. Just finished implementing some dank candle graphs.

Rate and hate :^)
>>
>>61689722
sexy as it is
>>
>>61689663
>Let me know if you have any more questions you fucking moron. Please end your life I seriously hope you did not "graduate" whatever "Educational Institution" you "attended" without finding out what an IP address or DNS record is.
I forget sometimes that /wdg/ is on 4chan since I have a bookmarklet for it in my webdev bookmarks folder which means I never need to browse any other part of the site. I hope that you get through whatever is troubling you, kid
>>
>>61689742
ur a dum ha hah a
>>
Referring to Mongoose. Are schemas/models essentially blueprints to derive instances from?
>>
>>61689729
thanks desu
>>
How do I append multiple elements in Javascript?
function buildQuiz() {
firstq.textContent = question1.question;
list.appendChild(listitem).innerHTML = question1.answers.a;
list.appendChild(listitem).innerHTML = question1.answers.b;
}

Building a quiz and would like to have four answers appended to each question. I would like to retain the innerHTML property since I will be adding checkboxes. Any thoughts, /wdg/?
>>
>>61689722
The UI has a sort of harsh business-vibe to it as is. If you're going to use Windows and write your application's UI as a webapp, you may as well keep the harsh business-vibe.
>>
>>61689919
Forgot to add that my issue at the moment is the latter appendChild replacing the first one, so the string from answers.b shows up instead of answers.a.
>>
node.js core dumps why
I'm not smart enough to debug this shit
>>
>>61689713
why not go to jsperf and try it out
>>
>>61689919

appendChild just moves the element. So by appending twice you are moving the element into the list, then out of the list and back into the list.
>>
>>61689919
>>61690188

Follow up, you could do it like this.

var list = document.getElementById('list'),
answers = ['op', 'is', 'a', 'faggot'];

answers.forEach(function(answer){
var elem = document.createElement('div');
elem.innerHTML= answer;
list.appendChild(elem);
})
>>
>>61689663
>Let me know if you have any more questions you fucking moron. Please end your life I seriously hope you did not "graduate" whatever "Educational Institution" you "attended" without finding out what an IP address or DNS record is.

You're the fucking moron here, for not knowing that /wdg/ is 90% self-taught neets trying to catch their first break. Yeah, not all of us knew what a DNS record was before we started programming.
>>
>>61691054
Not him, but my first words as a baby were "DNS"
>>
>>61689602
No closing paren
>>
File: 1501392780473.png (222KB, 399x250px) Image search: [Google]
1501392780473.png
222KB, 399x250px
>>61691054
except that he's right, if you're trying to webdev without knowing what a web is you might need to catch up on your reading
>>
What do you think about GraphQL?
>>
>>61691054
don't drag us self-taught neets into your ignorant mess desu
>>
>>61689663
That was a good explanation, but jesus dude, get off your high horse.

That attitude will keep you back in your career. No one wants to hire a cancerous asshole who makes people feel stupid for asking honest questions. The question anon was asking was a good question and isn't an easy one to google if you don't know where to start. It's one thing to shout people down for asking questions they can easily find answers for, but this is the kind of question that one should ask a human.

Ignorance is a temporary problem that goes away as soon as a person asks for and receives a answer. You can keep people around you ignorant by discouraging them from asking questions, but that doesn't make you smarter. It lowers the level of everyone around you and makes you dumb, which (unlike ignorance) is often a terminal affliction.

Assuming you're new to the tech job market, get your shit together before it's too late. You really don't want to be known as the brilliant asshole who brings down the overall level of whatever team you join.
>>
>>61691444
>loser goes on 4chan to rant about how others should behave because he clearly has a career worth imitating
what's troubling you babe?
>>
>>61691482
How is your career going?
>>
>>61691482
>projecting
>>
File: 1500559955946.jpg (147KB, 800x1054px) Image search: [Google]
1500559955946.jpg
147KB, 800x1054px
So I'm learning how to use express js. I read the MDN tutorial on it and now I'm trying to replicate the instructions, but on my own project. I chose to utilize the express application generator. I'm also trying to use the Blizzard API for some data I'd like to use on my website. My question is do I treat the url that I'm given from the API site and simply paste it onto a get method formed on my routes directory?

So would my code look like this
var express = require('express);
var router = express.Router();

router.get('https://us.api.battle.net/wow/leaderboard/3v3?locale=en_US&apikey=private', controller.randomFunction);


I'm really trying to make sense of all this but it seems like I'm turning out to be a slow learner. No bully plz.
>>
>>61692086
just try calling the api and see if this works
for requests about user data you might need to authenticate with oauth
>>
>>61691502
Pretty great, passed the 5k/mo milestone in june!
>>
>>61692154
I can't just yet. I need to configure some view files that I'm still confused about because they're created using the pug template engine. So I can't really set up the template to preview all the data and I'm not too versed in finding out in another way.
>>
>>61692167
just paste url in your browser, use curl or postman
>>
>>61692162
I'm at 2-3K :(

What kind of stuff do you do?
>>
File: 1499737433525.jpg (22KB, 540x540px) Image search: [Google]
1499737433525.jpg
22KB, 540x540px
>>61692162
>pretty great
>5k/mo
>>
>>61692184
The url works fine by itself. I was previously using the xmlhttprequest and just using regular javascript to call the api. Now I'm trying to move on to express js and wondering if instead of using the xml module I was using before, if the new way is the
router.get('url', callback function);

way

I'm trying my hardest to be clear.
>>
>>61689460
No you're an utter disgrace for anybody here. If you're not able to browse to a website and download software you should fucking end yourself or consider >>>/r/eddit as you new home board.
>>
>>61692202
It's not my full time job... yet.

>>61692195
You'll keep growing don't fret! Right now I do two things, a saas targeting apartment owners, and vidya sites - the latter doesn't make as much but it's hobby fulfillment basically.
>>
>>61692272
You know what you and the Reddit community have in common? You're both pretentious and immature snobs.
>>
>>61689722
Looks good.

>tfw have about 30k WAVES from ICO pending approval to be sent to me

I've been waiting a week.
>>
>>61692202
5k a month isn't bad at all.

You must live in a city or something where you get nickel and dimed to death.

Average household income where I'm at is 36k. I make 62k. I live basically like a king here. Even gas is under 2 dollars. My rent is only 915 for a place you would pay 3500 a month for in a city.
>>
>>61692337
idgaf >>>/r/eddit
>>
>>61692438
I have both tabs open.
>>
>>61692438
btw, what's a good subreddit that will help me with learning express and mongoose and mongodb and all that? All that in one?
>>
I'm starting all over again. I need ideas for a website I can create that I can also appropriately jot down on my resume for an internship. I want to build this website using node.js and mongodb. Fork those ideas over.
>>
Guys, I am new to this whole wordpress thing, got a sideproject suddenly. Is buying a kewl wp theme a good route? Do they charge monthly?
>>
>>61692926
depends on how much money and time you're willing to spend on this
i have lots of free time and no moneyz so i usually just take an existing free theme, customize it through ui and then slightly edit theme files if i need further customization

if you have some moneyz but no time just buy a good looking theme

if you have more time and basic design skills you could try making your own theme
>>
>>61692926
>>61693034

Or just make your own damn website

You don't even need to use jquery or any meme framework
>>
>>61693034
Not my money, I can easily get another $50 from the client for the theme, so. This is a one time purchase right?

>>61693277
Eh, I am not that into webdev or design
>>
File: 1501465388310.jpg (71KB, 285x279px) Image search: [Google]
1501465388310.jpg
71KB, 285x279px
Using crystal and-
"#{{{File.real_path(filename)|}}}/#{{{filename}}}.cr"

really nigga?
>>
>>61693303
>This is a one time purchase right?
should be
this should be mentionned on theme shop site or designer's site, look it up
>>
>>61693034
>>61693277
>>61693408
Ok, thanks faam
>>
>>61691444
ever strike you that people may act differently in a professional situation
>>
>>61692337
if not even reddit is enough of a hugbox for you maybe you should try to pick up an obscure gender identity and fight the gender gap between men and trans-fats on tumblr?
>>
hey fellas,
i wanna match my dev environment with production with vargant/docker/packer/linuxkit combo to harness immutable server pattern. so each time i wanna push updates - i build & deploy new server images and kill the old ones. anyone using the same or similar setup? will i live a happy life?
>>
>>61692694
Edit: why the downvotes?
Edit: thanks for the gold
>>
What do I do for oauth_body_hash?

I can't find anything on the web.
>>
>>61689304
>pajeets not using only wordpress.
you mean pajeet.php.
>>
>>61693763
its a frontend framework for pajeets lol... it will be something like jquery, but with more chained methods..
>>
How can I get google to index 100 million pages of my website? I submitted a sitemap but the bot stopped around 4 million.
>>
File: 1486453145008.png (23KB, 212x172px) Image search: [Google]
1486453145008.png
23KB, 212x172px
>Been using JavaEE and Ruby on Rails since college
>Node.js explodes into the scene
>Try to learn it every couple of months but give up every time because the syntax is ugly as fuck, tutorials are scarce, and I get confused about which javascript code is back-end or front-end
>>
>>61694398
>suddenly ceo appears
>"hey boys you can node.js, right?"
>we sit in silence
fuck
I really need to get to that shit soon
>>
File: 1496165985275.png (15KB, 344x135px) Image search: [Google]
1496165985275.png
15KB, 344x135px
>>61694522
doesn't look complex desu, just kind of a clusterfuck due to the availability of many different tools fulfilling the same purposes
>>
>>61689264
nice for prototypes
pain in the everything to scale past 10-ish concurrent users
>>
>>61694398
>syntax is ugly as fuck
whats bad about JS syntax compared to the other languages you are used to?
>which javascript code is back-end or front-end
If it's executed on the server it's backend code.
What's the cause for confusion here?
>>
>tfw I have all these great programming PDFs I've read but can't display them on my bookshelf

Do any of you have an auxiliary monitor to display your ebooks?
>>
>>61695026
buy a printer desu
>>
File: gonzalez.jpg (131KB, 503x466px) Image search: [Google]
gonzalez.jpg
131KB, 503x466px
>>61695026
bought shitty old 19'' for that purpose, ye

eink reader helps a ton, sometimes I print some pdfs provided I can freely use office printer
>>
>>61692086
So, you either need to use the built in http module, or the request module (makes it easier). You're code should look something like this

app.get('/', (req, res, next) => {
axios.get('blizzardApi.url')
.then(data => res.json(data))
})


essentially, you should be calling the api request inside the express route
>>
>>61692086
var express = require('express');
var request = require('request');

var app = express();

app.get('wewlad', (req, res, next) => {
request({
method: 'get',
uri: 'https://us.api.battle.net/wow/leaderboard/3v3?locale=en_US&apikey=private'
}, (err, res, body) => {
try {
res.json(JSON.parse(body));
}catch(e){
res.end(500);
}
});
});

app.listen(3000);


i like ur semen demon
>>
>>61689007
what is that color scheme and is there an android studio version and kotlin
>>
File: 144460823986.png (114KB, 300x300px) Image search: [Google]
144460823986.png
114KB, 300x300px
>hate websites that don't work without javascript
>tempted to make a website that doesn't work without javascript

I hate this world
>>
>>61689293
My goal in life is to get a JS dev job so I can make a framework called curry.js, which is not overtly anti-pajeet but is still funny.

Also, why are there so many different frameworks?
>>
>>61696902
curry/currying has a context in programming, so won't be funny
https://en.wikipedia.org/wiki/Currying
>>
>>61696533
Congratulations, you've discovered that making modern websites without relying on technologies like JS is impossible. Hopefully now you can stop moaning about sites that use JS.
>>
File: Screenshot_2017-08-02_17-03-07.png (216KB, 1920x1080px) Image search: [Google]
Screenshot_2017-08-02_17-03-07.png
216KB, 1920x1080px
Still working on the loan app

Boss gave me a nice screen for free :)
>>
sys.4chan.org/tv/post

nice REST you got here
>>
>>61689722
Socket.io?
>>
What would be better for a polling/survey type webapp, relational or non relational database?
>>
File: bush_exasperated.jpg (18KB, 500x375px) Image search: [Google]
bush_exasperated.jpg
18KB, 500x375px
Should I just go ahead and learn jQuery since a lot of people use it? Or should I stick to my guns and not learn any external libraries unless it is absolutely necessary, e.g. node.js?
>>
>>61699786
jquerry used to be the shit, especially since it helps you support old brosers
now there's a bazillion of js libs and frameworks, you should learn one of these frameworks instead and use it for bigger projects while still not using external stuff for small projects
>>
>>61699841
But all the job postings ask for jQuery knowledge, even if it is old as fuck and outdated now...

I may as well learn it. There's not much to learn anyway.
>>
>>61699894
sure if there's demand for it learn it
>>
Can I use github pages without doing a whole gay new branch? I just wanna host my shit mang. I get a 404 when I try to use the master branch.
>>
Redpill me on Laravel
>>
File: shitcoins4.jpg (85KB, 1113x695px) Image search: [Google]
shitcoins4.jpg
85KB, 1113x695px
>>61699243

curl for now. I'm making calls at a relatively low frequency (~1 Hz for ticker and ~1/30 for market history due to file size). Might be worth a look at sockets later although these markets move so slowly I don't know if it's worth the effort.

For now I'm just working on the interface and prediction modelling, as well as giving my bot a sassy personality.
>>
>>61689713
I remember reading an old article about how the latter was even slower than jQuery
>>
Whenever a project of mine gets large enough I find myself staring at code I wrote instead of writing new code. How do I fix this? Is it autism?
>>
Is there anything wrong with not using an ORM in a large project? I get things done so much quicker with raw queries, and all of my databases are simple enough that someone could just look at a column name and know what its for. Will my future employees/team mates hate me?
>>
Sans serif font suggestions for a web app dashboard? I honestly can't tell what's most pleasing. I'm insecure about any choice that I make myself design wise. I'm using Work Sans right now and the letters seem to be spaced wider than most fonts and I'm worried it will turn people off to my product somehow. Please console me
>>
>>61700022
Its a nice framework and makes web dev in PHP a little more bearable for people coming from other languages
>>
Had the final round interview for "senior hybrid mobile developer/specialist" at bigasshealthcarecompany today

6 people in a big meeting room, hour and a half technical.

There was 30 or so questions, mostly about my approach to problems, ionic2, angular 4, typescript.

How would you display 5000 items in a list accounting for performance?

Then about half an hour on interacting with offshore teams in various time zones.

Challenges i faced as team lead in current role.
Methodology used. Interacting with higher ups, executives, clients.

Office looked like Facebook, really nice location out of Toronto but same paygrade.

I did very well on the interview, recruiter that found me said I'll have an answer by tomorrow.
Wish me luck nerds.
>>
If I put up a landing page that is well designed, with six or so web site projects in my protfolio of basic ecommerce/landing page stuff, can I realistically expect to find any freelance or in-house work?
>>
How long can I get away without my backend being completely asynchronous? I can understand wanting IO to be async, but every small operation?
>>
>>61700582
You would probably need more portfolio pieces with more desirable skills for freelance.

You could make Shitty WordPress sites and get paid shit but what's the fun in that
>>
>>61700348
the extra abstraction layer allows you to decouple db calls from rest of the application
so it will suck if you use rdbms specific functions and those change over a version for some reason or if you have to change rdbms alltogether at some point
otherwise you probably shouldn't give a fuck, except that writing sql requests might take more lines than calling an orm function
>>
>>61700471
gud lucc nerd
>>
>>61700627
Depending on what you're using, you can go quite far without making everything asynchronous. Plenty of major websites rely on older languages/frameworks that don't support that kind of thing and do just fine. You can pretty much always just run multiple app instances. If you're talking about node, it's pretty well optimized for async stuff so you generally want to take advantage of it where you can.
>>
>>61700808

I'm just trying to figure out what skills I actually need to be able to show in projects to go get a job
>>
>>61701085
>get a list of jobs in the area of interest
>sort by most demanded skills
>learn it
>>
>>61700471
So open floor plan? RIP
>>
>just found out about data attributes in html5

I've been working on a shitty web app for ~3 months and the entire time, I was storing info in hidden tables/spans. I feel like the dumbest nigger on the planet
>>
>>61701524

Holy Fuck that's bad please post code
>>
>>61701085
How strong is your programming background?

If you really want a job, read the entire documentation for typescript, then angular.

Like every page they have available, write out the examples and modify.

Make some app that reads Reddit or some shit and you could go get in as junior.

You'll save yourself time if you spend time to seriously familiarize yourself with Javascript.
>>
>>61689877
Yes. Schemas are essentially table 'formats' in mongodb (and, consequently, mongoose). So:
var mongoose = require('mongoose');

var userSchema = new mongoose.Schema({
name:String,
password:String,
salt:String,
age:Number,
activities:[{
name:String,
time:Date,
type:Number
}]
}, { collection: 'Players' });

mongoose.model('Players', userSchema);


would create a schema for a table 'Players' with five fields.
>>
>>61689663
>127.0.0.1 is what's known as a loopback ip address
>You could even say it loops back
>I'm clever bcuz I used the word in its own definition.
Fuck off. And ending every sentence with a bloody explanation mark makes you look like you're about twelve.
>>
as the fucking dumb newbie I am I just discovered there are other server-side scripting languages than php. which is the best sss language if I'm going to use java and sql? I crave to be a back-end java delevoper
>>
File: crowdcookie.png (893B, 116x116px) Image search: [Google]
crowdcookie.png
893B, 116x116px
I repurposed a site I made here like half a year ago.

It's now an """"app""""

Tell me how bad the design is.

Scan the QR to download on android.
>>
>>61689722
Impressive! I've been working on something a little similar. What did you use for your candlestick graphs? I couldn't find anything that looked as sharp as yours. Did you write something to generate them?
>>
>>61689602
Assuming you include the closing parens as >>61691260 says, what exactly are you trying to do here? Unless I'm mistaken, I believe $set requires an object, containing the field to update as well as the new contents. So for a document:
{
name:'bob',
age:'54',
location:'moon'
}

in a collection "spaceDudes", you'd do 'collection.update({name:"bob"}, {$set{location:'uranus'}},callbackFn())';
Normally you don't actually need to use $set, and instead can just do 'collection.update({name:"bob"}, {location:'uranus'},callbackFn())'.
Finally, is either plupdate or update some sort of function run on the document (i.e., an instance method or something)? If so, update won't work here; you'll need to use findOne() and save() instead
>>
File: phpmyadmin.jpg (55KB, 510x255px) Image search: [Google]
phpmyadmin.jpg
55KB, 510x255px
Hi PHP gurus! My php json_encode is outputting extra values.
I have no idea where those extra values came from. I googled and
found like 3 answers saying to use
mysql_fetch_assoc
. I tried it but still no change.
Does anyone ever encountered this?
Pic related is the phpmyadmin table

Here is the echo of json_decode:
As you can see there are the extra values:
{
"id": "24",
"0": "24",
"first_name": "changed1",
"1": "changed1",
"last_name": "Rambo",
"2": "Rambo",
"email": "[email protected]",
"3": "[email protected]"
}


The expected result should be:
{
"id": "24",
"first_name": "changed1",
"last_name": "Rambo",
"email": "[email protected]",
}


Here is the php code:
try{
$sql = "SELECT * FROM test_table1";
$result = $pdo->query($sql);

if($result->rowCount() > 0){
$encode = array();

while($row = $result->fetch()){
$encode[] = $row;
}

echo json_encode($encode);

// Free result set
unset($result);

// other codes snipped...
>>
File: pharah.jpg (402KB, 1808x1017px) Image search: [Google]
pharah.jpg
402KB, 1808x1017px
okay guys learning the basics of JS now.

When should I move onto learning a JS framework? No job wants a jr dev who doesn't have a JS framework under their belt.. I just know basic HTML/CSS and learning JS like I said so I have a long way to go but just curious.
>>
>>61702912
when you are able to use javascript for everything you need
>>
>>61701888
It's mostly shit like this

 
var movieQueue = [];

//ex. <tr> <td class='movie-id hidden'>tt0133093</td> <td class='movie-title'>The Matrix</td> <td class='movie-score'>4.25</td> <td> <input name='queuedMovie' type='checkbox'> </td> </tr>
$('input[name=queuedMovie]:checked').each(function(i,row){
movieQueue.push({
"id": $(row).parent().parent().find('.movie-id').html(),
"title": $(row).parent().parent().find('.movie-title').html(),
"rating": parseFloat($(row).parent().parent().find('.movie-score').html())
});
});


The extend of my learning is like some 2 hour HTML/Jquery tutorial from 2012
>>
>>61702912
jQuery is a good start.

It's pretty shit desu, but a lot of jobs still use it. Both I've had in the last 6 months have used it.
>>
Caved and bought a shitty old thinkpad for linux. Windows + python = utter bullshit
>>
>>61694398
This I really hate the syntax it's really ugly
>>
>>61689454
It's THE PHP framework to use.
>>
Should I just learn Typescript if I don't know Javascript? Sounds like it's better in every conceivable way.
>>
>>61702912
Eh, honestly, and to be completely unhelpful... when you feel ready. It's good that you recognize you've got a road ahead of you, but there's unfortunately no magic 'test'. What you DON'T wanna do is jump into a framework before you really understand the essential principles of JS - prototypal inheritance, async JS, object vs function oriented programming, probly some concepts i'm forgetting.
I'm actually gonna disagree with >>61703110 a bit. I think as long as you have a good FOUNDATION in JS, learning a certain framework and seeing how they do certain things might help you understand the language better.
>>
>>61702848
you fucked up something with array
try without
 $encode=array(); 
or some shit with that stuff below
also, why do you use json here?
completely unneeded
>>
>>61692162
5K Gross? or 5K net?
>>
>>61702848
I have this shit happen the other day.

Forget how I fixed it.

Try json_encode ($string, true)
>>
Every once and a while, webpack stops watching my directory. And I can't get it back. Have to delete the fucking folder and checkout again.

Is there some lock file that fucks up or something?
>>
File: 1460040182913s.jpg (6KB, 225x250px) Image search: [Google]
1460040182913s.jpg
6KB, 225x250px
working on wiby.me

current task: migrate from Apache to nginx
>>
File: Professionalism.png (24KB, 713x344px) Image search: [Google]
Professionalism.png
24KB, 713x344px
How you know your VPS provider is professional.
>>
>>61704622
god damn da switch is flappin agin!
>>
>>61704622
>engineer
>singular
>>
>>61704216
>Every once and a while, webpack stops watching my directory
I've never had that happen but couldn't you just ctrl-c webpack and rerun it?

I run webpack in a screen session and attach and detach as needed to check how my builds are going. It's handy to be able to see the output so I know when I fuck something up.
>>
>>61705120
no, it still doesn't watch it
>>
>>61704622
>tfw you have to apologize to your customers because your swich is flapping up and down in public.
>>
File: wowwebsite.png (166KB, 1855x1056px) Image search: [Google]
wowwebsite.png
166KB, 1855x1056px
how can i copy the player and realm names and inject them onto a url that I will use to make an http request to a 3rd party api?
>>
>>61705598
There's a Python scraping library but you'd be better off checking the html source to see if there's any class/id tagging of the column fields that could be used.

The best solution is to acquire the table data as json in the first place, possibly from the same API you want to interrogate.
>>
>>61705627
I'm not sure what you're saying.
>>
>>61705761
Then you're probably not at the stage where you can write code to do web functions.
>>
>>61703565
>why do you use json here
People here have mentioned before that its better for php to spit out json then just fetch it via ajax/axios for display/manipulating the data. They said that it separates the backed from frontend code. Actually I tried that approach earlier and it works nice, just those goddamn "extra values" are fucking annoying
>>
>>61705915
okay how about you try to reiterate in a clearer manner instead of resorting to immature and insulting remarks.
>>
>>61706028
It's as clear as it gets. If you don't understand that then you aren't ready to be coding web apps. Learn some programming first.
>>
>>61706065
you have a lot of growing up to do.
>>
>>61706107
You have a lot of learning to do.
>>
>>61706112
that's why im on here asking questions. then i run into a jackass... just quit replying i found someone else more competent that can actually teach.
>>
>>61705627
>There's a Python scraping library
BeautifulSoup
>>
>>61706121
You asked a question, he answered it, you don't know very simple terms that are used every day in web development. Sorry, but 4chan is not the place to define terms and teach you programming 101. There are far better sites to do that.
>>
>>61706132
omg i found someone that is actually helping me and you guys are still pushing the idea that its all my fault! this is 4chan. most people here are 15 year old edgy autists. I shouldn't be surprised!
>>
>>61706132
Not to mention that there are links in the OP that anon could actually use to learn webdev101
>>
>>61706121
>i found someone else more competent that can actually teach.

You mean you roped in some other gullible person to go your learning for you. If you can't read the most basic concepts from the millions of tutorials, but instead need another human to waste their time explaining it to you, you are not ready for the programming industry. The people who did this at uni dropped out after the first year. The best advice anyone can give you, is learn how to google, learn how to read, learn how you learn best (without resorting to wasting other people's time.)
>>
>>61706162
>omg i found someone that is actually helping me
Obviously you didn't find them in this thread now, did you?
>>
>>61706172
>>61706174
self-righteous edgy fucks. why is this place so much like reddit? anyway i solved the problem. have fun being bitter for the rest of your lives.
>>
>>61706185
How much bait could a baitsman bait if a baitsman could bait bait?
>>
>>61706174
>have fun being bitter for the rest of your lives
I'm not bitter, I'm self-righteous and edgy!
Self-righteous is almost the opposite of bitter, that's what makes it so insufferable for others, it's so comfy being self-righteous that it looks like those people are avoiding karma.
>>
>>61706028
He isn't being insulting; If you don't know what checking the HTML source, or class/id means, you cannot seriously expect to... what was it? 'inject them onto a url'?
We can't teach you to program if you don't even know the basics.

>>61706107
nah, you need to stop pretending that people are here to serve you.

>>61706121
Because you want a handout, he's a jackass? okay buddy.

Holy shit, what a whiny little bitch.
>>
4channers are so good at hamstering lmao. fact of the matter is that all of you are immature and don't know how to behave appropriately.
>>
>>61706236
I asked for help. No one is forced to help me. The guy tried helping me. I told him I simply didn't understand and if he didn't mind repeating himself more clearly. He took it personally and resorted to say that I'm simply too stupid to get it. I call him a jackass as I should have.

Only idiots think I'm in the wrong.
>>
File: dis_nigga_serious.png (81KB, 281x299px) Image search: [Google]
dis_nigga_serious.png
81KB, 281x299px
>>61706316
>Only idiots think I'm in the wrong
>>
>>61706938
Provide me a counterargument
>>
mic test one two
>>
>>61702714

The graph is just plain old Canvas/JS. You can use my code if you like.


drawCandle: function(open, close, high, low, volume, time, candleWidth) {
var x, width, height, volumeHeight;

width = candleWidth * this.cvs.width;
x = (1 - time) * this.cvs.width - width / 2;

// render volume

volumeHeight = volume * 0.25 * this.cvs.height;

this.ctx.fillStyle = '#eee';
this.ctx.fillRect(x - width / 2, this.cvs.height - volumeHeight, width, volumeHeight);



part 1/2...
>>
File: shitcoins6.jpg (33KB, 888x394px) Image search: [Google]
shitcoins6.jpg
33KB, 888x394px
>>61707205
>>61702714

2/? cont...

    // render candle wicks
this.ctx.beginPath();
this.ctx.moveTo(x, (1 - high) * this.cvs.height);
this.ctx.lineTo(x, (open > close) ? (1 - open) *
this.cvs.height : (1 - close) * this.cvs.height);
this.ctx.moveTo(x, (1 - low) * this.cvs.height);
this.ctx.lineTo(x, (open > close) ? (1 - close) *
this.cvs.height : (1 - open) * this.cvs.height);
this.ctx.stroke();
>>
>>61707235
>>61707235
3/?...

    height = (1 - close) * this.cvs.height - (1 - open) *
this.cvs.height;
this.ctx.fillStyle = (open > close) ? '#000 : '#fff';
this.ctx.fillRect(x - width / 2, (1 - open) *
this.cvs.height, width, height);
this.ctx.strokeRect(x - width / 2, (1 - open) *
this.cvs.height, width, height);
}
>>
>>61707294
>>61707235
4/4

Note that all the input values must be between 0 and 1, so you'll need to normalise your data beforehand. This is so I can scale the Canvas element to any size and preserve the graph. Also note that the Canvas axis is an inverted Cartesian plane (both x and y are flipped), so I am reversing all the values (1 - open) etc.
>>
I have an idea for a website, its gaming which does well for advertising returns, but its too complex for my ability, it requires stuff like OCR.

How do I go about getting help developing this, without them just turning round and stealing the idea. I understand people will be skeptical but this isn't another "its like Facebook but for a smaller audience" thing.
>>
>>61707338

Ideas aren't worth shit.

>How do I go about getting help developing this

Pay someone, obviously.
>>
>>61707425

Sure I understand I need to either pay or give up a piece, but my question was what is stopping someone from taking it once I have asked them if they can develop it.
>>
>>61707434

A contract.
>>
I'm trying to learn web dev through the MDN tutorials and I'm finding out that I can't make any sense of most of the stuff that's written on there. What should I do?
>>
>>61699894
Without ever intending to, I learned jQuery. It's not hard, it makes sense, and it's a dependency for other things, so it's handy to have on your toolbelt.
>>61699841
But yeah, there's other stuff.
Angular = Ruby on Rails for the browser
React = the DirectX API for the browser. ALso the V in MVC
Underscore = functional shit for the browser
Backbone = The M (and C ?) in MVC
Also see Vue, although I forget what for.
Also see Bootstrap, for widgets, it's quite popular
There's things like sockets.io and express.js which handle limited scope (_almost_ UNIXy although there ain't norhting UNIXy about the web)
>>
>>61701085
I still don't have a portfolio and I been landing jobs for over 15 years. But then again, I live in the backend. Just in the last year I'm being forced into the full stack meme and so here I am.

Of course, if you design fonts, then yeah, make a portfolio and prepare to have it ripped off endlessly
>>
>>61689405
you're stupid, go install linux and come back in 2 years when you know how to move a binary or click on db.exe
>>
File: heretic.png (81KB, 350x350px) Image search: [Google]
heretic.png
81KB, 350x350px
>>61689663
hey poster,
i'm with you, what are all those morons doing here?
>>
why are le 4channers so deliberately edgy?
>>
>>61689007
What is the best way to learn Reactjs?
>>
Anyone here use the mern stack? How would you go about learning it if you had to do it all over again?

I've dabbled in every aspect of it already and feeling really unorganized.
>>
>>61708083
I found the official tutorials pretty straight-forward. I ran into some trouble later on but solving those troubles taught me a lot about the internals of React.

p.s. never forget to put keys on everything, it will save you time later
>>
>>61689293
imagine a JS library called React

what kind of (((koder))) would name a JS library ReactJS
>>
File: 1496862145250.png (461KB, 611x686px) Image search: [Google]
1496862145250.png
461KB, 611x686px
>>61708450
>call it React
>actually needs other libs like MobX to automatically react to state changes
>>
working with node/express for the first time. what is it that dictates what router is ran? is it simply all dictated by the url you pull up?
>>
>>61708083
The "React Fundamentals" by the guys that made react-router is the one I followed. I'm assuming you already know your way around Javascript: if so, try that tutorial, it's short but very informative

I'll take the opportunity to ask: what's the best way to learn Redux? I've been at it for a while now and it's becoming easier and easier but I'm wondering if you guys know of a particularly good resource besides the documentation and Dan Abramov's videos on Egghead
>>
File: 163220.jpg (46KB, 450x543px) Image search: [Google]
163220.jpg
46KB, 450x543px
I've been obsessed with Node lately, I can't explain it but I just have a lot of fun building apps with it (express, hapi, some meteor).

Though I guess that I should probably go back to learning a JS front end framework instead, if I ever want to land babby's first dev job.
>>
>>61707205
>>61707235
>>61707294
>>61707304
Thank you man!! And as for machine learning/AI/neural net resources/where you started, what did you begin with if you don't mind my asking?
>>
>>61709931

I'm not sure neural networks are particularly applicable to stock markets, but my understanding is pretty rudimentary. This is a good primer on NN if you don't mind a little maths.

http://neuralnetworksanddeeplearning.com/chap1.html
>>
>>61707425
This.

Also anyone who has developed an idea has ran into that idea turning into shit for no apparent reason after months of developing.

Let me guess, your idea is a metacritic for games?
>>
>>61709004
>The "React Fundamentals" by the guys that made react-router
Can you link it pls?
>>
How bad is it to use Markdown for most everything?
>>
>work says they will pay for udemy courses

Niiiice, just got a 25 hour course on node and react.
>>
>>61705598
Use curl to download the html and grab what you need with regex.
>>
>>61710194
What did you end up using for the trading bot, then? Did you just program rules in?
>>
>>61711390
>paying for udemy courses
>>
>>61711910

Yep, just hard numbers. It's a work in progress. The logic is pretty shabby right now.
>>
File: 1475298967684.png (219KB, 378x454px) Image search: [Google]
1475298967684.png
219KB, 378x454px
Hi guys,
I installed apache, mariadb, php and generated my own selfish certificate.
Everything works perfectly on my local lan,I put a title, an h2 intro, a p message and a button to my first page, I really love it. The thing is, I was looking for domain names and vps services, the domain provider is offering me services I don't need, and saying stupid things like
>BUY THIS AND GET 3 EMAIL ADDRESSES
Why are them selling me email addresses? Don't you make your own mail server using the domain name bought?
Am I getting tricked? I don't know where I should register my domain name
>>
File: 15014262064270.jpg (123KB, 640x640px) Image search: [Google]
15014262064270.jpg
123KB, 640x640px
This should take input from user via POST, then return test.html with Kys, {{ name }}! rendered and a blank input field.
It does not. What do?

https://pastebin.com/Bv0c3SNF
>>
>>61712549
I'm selfish, your certificate probably is not.
Before renting online space, compare prices, and look for (valid) reviews about the hosting provider on tech forums.
The emails will be created for you, they don't come automatically with a domain registration.
>>
>>61712549
Get your domain independent from your hosting. Never get them in one bundle.
With shared hosting providers you usually have offers like
>X subdomains,
>Y databases
>Z mailboxes
etc.

With a VPS you have complete freedom but also have to do everything yourself.
GSuite from google is a good option for emails on your own custom domain, if you don't mind the botnet.
>>
>>61712549
avoid godaddy since they're scummy. i host my website / other shit on vps from OVH and bought domain from another place. I setup email for my domain on zoho, but i doubt im ever gonna do something with it
>>
How do I setup development & production wordpress site versions?
>>
Hey guys, is it illegal or bad form to wrap a div element in an anchor?
>>
>>61713133
it's fine as long as she's past age of consent in your country
>>
>>61713173
I mean, it works and does what I want, but is it not acceptable? I found a reference on stackoverflow saying to not do it and that it is illegal, but then a newer comment said that in html5 that it's okay.

Just curious if what I did is a no-no or not.
>>
>>61713244
Link?

I do it all the time, especially when doing feeds. eg:


<div class='feed__item'>
<a href='/page/'>
<div class='feed__item__inner'>
// heaps of divs
</div>
</a>
</div>

>>
>>61713133
Give the a element and the span element a 'display:block' property, and your html will be valid html5!

<a class="container-link" href="">
<span class="container-inner">
<i>zomg</i>
</span>
</a>
>>
My code is shit and embarrassing but does the job.

I've been killing myself trying to find a more elegant solution and I think I'm close to finding one, but for now it's fucking terrible. Yet shit works.

Is it acceptable? Is ugly code acceptable if it does the job?
>>
File: 1501447184205.png (9KB, 300x300px) Image search: [Google]
1501447184205.png
9KB, 300x300px
Doing single page web app without any frameworks.
What's the cleanest way to change main content when switching tabs, do i :
a. hide-unhide html i've written in main html file
b. load html content from different files using some template system
c. generate html using js
>>
>>61713602
Use node with partials.
>>
>>61713602
jQuerry.
>>
>>61713600
Ugly code is fine until you need to fix bugs or add features.
Then it wastes more time and money.
It's called technical debt for this reason.
>>
>>61713442
This is essentially what I did.

>>61713508
This works essentially the same as what I did. Is this the preferred method?

Back in html 4, it wasn't valid, but html 5 specs state that it's okay as long as there aren't interactive items inside the div. I'm just starting out and I want to minimize bad habits if I can.
>>
>>61711987
I get them freeeee
>>
>>61713600
Ugly code is normal.

You just go threw and clean it up. Remove extra shit and fix your formating.
>>
>>61701948

I'm currently just doing front end stuff and learning about marketing/ecommerce. Am I approaching this backwards, like should I just learn javascript before going into the easier aspects of dev?

How long does it take to learn JS? I have 4 days off a week and my gf is a gifted comp sci student who wrote out multiple working version of fizzbuzz for me last night in a few minutes, so I have support for any roadblocks.
>>
>>61714209
Javascript is part of the front end stuff.

Learn and master html, css, that should be pretty quick, then you're going to spend the rest of your time learning the javascript monster. It's gonna be a long and fun road.
>>
$test =new TestClass ("something");
Echo $test;

TestClass returns a string. Why isnt this working?
>>
>>61713602
https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_tabs_dynamic&stacked=h
>>
>>61714265
>learn and master css
>quickly
good luck with that
>>
>>61714265

Does it matter at all what language I pick up for the back end? My udemy course uses Node.js for the backend I believe.

I'd eventually like to be comfortable with python/ruby/c#
>>
>>61714468
Node is wonderful because it's simply javascript for the backend, so it's good that you're learning how to use it. Plus it became very popular.
>>
Math.floor(Math.random() * 100)

A good way to get a truly random number or a biased one?
>>
>>61714541
I'm just starting webdev stuff and my brother is trying to convince me to learn go for backend stuff, instead of python or ruby on rails or whatever. Is go a decent choice?
>>
>>61714565
function getRandomNumber() { 
return 4;
}


There you go.
>>
>>61714619
>Is go a decent choice
No, if anything go for Python. Look at the stats out there, the programming languages in demand, and don't listen to your brother. What the fuck honestly.
>>
>>61714652
He uses it for work and I maybe he wants more people to use it? Not sure.
>>
>>61714630

Chosen by a fair dice roll. Guaranteed random.
>>
>>61714565
There is no such thing as true randomness.

You can simulate true randomness just like the real world does by increasing variables to a ridiculous degree, getting random numbers through external scripts, turn the webcam on with item recognition to count room objects, total keypresses while on your site. Then add it all together and get the average.
>>
Give me the truth about web development, the "red """pill"""" as they say
>>
>>61715264

High stress, not great wages
>>
>>61715264
It's cool.
>>
rails or node?
>>
>>61708749
Exactly. That's basically what a server does in general. When you go to "mysite.com/somePage", you aren't actually navigating to the "/somePage" folder on that server's "drive". Instead, you're saying to the server, "gimme whatever response is appropriate to /somePage".
This allows you to do stuff with the router that DOESN'T involve specifically going to a resource. For example, a (badly-named) route might be "mySite.com/goToProfileButRecordMeFirst", where the router first records your visit, and THEN sends you to the profile (and presumably does neither if your login fails).
In the case of express/node (and presumably most routers), remember that the ORDER of routes matters. So in the case of:
// the * means "all routes")
router.get('*',function(req,res,next){
//do some stuff
res.send('hi!');
});
router.get('/someSpecificRoute',function(req,res,next){
//do some stuff
res.send('A specific route!');
});


then "/someSpecificRoute" will never trigger, because there's already a route registered for every route (including the /someSpecificRoute route). As such, you'd never see the message "A specific route!".
>>
I still don't understand why I need vuex (or redux)

>Directly modifying state shared by components is bad and hard to debug
Why?
I know exactly what each component does and how it interacts with the data.
Sure there can be bugs in the app, but it's certainly not from one component "unexpectedly" modifying the application state. How the fuck would that even happen, unless you are half asleep while writing your code.
>>
>>61715409
I went to a Rails bootcamp, couldn't find anything in Rails, and now I've been a node dev ever since.
>>
>>61715284
Dude, what?

I have no stress and make 2x more than the average household income.
>>
>>61715284
Eh, that'd be gamedev in most cases
My buddy seems to in a fuckedup crunch 24/7
>>
Angular or Vue or React?

I need to learn memes if I'm ever going to silicon valley.

Btw, is that dude here that got the job down there?
>>
>>61715592
I like Vue the most, though when it comes to jobs, you will see a lot more with React or Angular experience desired.
>>
>>61715284
I dunno about that, at my last job I made more than middle class family income and hardly would I describe the work as "high stress." The only high stress parts were dealing with pair programming.
>>
>>61715592
I have experience with Angular and Vue, but most postings I see are for React first, Angular second. But if you decide to go with Vue, I'm pretty positive Vue and React are pretty similar.
>>
Hey /g/ help me please.

I want to build a functionality for scanning (default for kodak scans) in my web application.
Since applets (NPAPI) is not supported anymore, how can I achieve this?

I've done some research and that's what I have:

>Usb Devices Chrome
https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web

>Scanner.js
https://asprise.com/scan/scannerjs/docs/html/scannerjs-sdk-api-request.html#scan-output-settings-save

>Scanner Access Now Easy (SANE)
https://en.wikipedia.org/wiki/Scanner_Access_Now_Easy

>WingScan
https://www.atalasoft.com/Products/WingScan

>Dynamic Web TWAIN
http://www.dynamsoft.com/Products/WebTWAIN_Overview.aspx

The problem is that I want a cheap or free solution. I'm totally lost. I appreciate any help.
Thanks
>>
>>61715592
1 or 3
>>
>>61715640
>>61715690
>>61716013
Thanks. React it is.
>>
>>61715264
extremely low entry barrier which means dumbasses think they can waltz in and make 300k to get people to sign up for wordpress
working on a team is hell due to a bunch of unnecessary steps added in so fags don't go ruining an entire company with one action
being a sole front end or back end dev is agony, put in some effort to understand 'the other side' so communication is faster
clients can be a fucking pain in the ass and the reason why you have 20+ projects basically finished but still no response

overall ok but fun
>>
reading this thread is painful

so many people who have no business touching code getting mad at anon's who answer their question in realistic ways.

if you dont know what http is, what a restful api is, what a mean stack is, the difference between mongodb and mysql you need to read a fucking book lmao

i lurk to see banter and some interesting projects, but all i've been seeing lately is children(or worse, adults) who don't know anything about programming trying to make web apps.

if you really want to learn webdev, learn vanilla js for a few months, learn node, and then move onto some frameworks
>>
>>61715958
How badly do you want this? Because it's not gonna be easy to roll your own. It looks like you'll need to write a plugin that connects to the scanner, since the browser can't do it on its own. And since two of the examples you provided seem to only support Windows, it looks like you'd have to have a version for each OS you want to support.

What exactly do you need scanning capabilities for?
>>
>>61710200
>Let me guess, your idea is a metacritic for games?
Doesn't metacritic already do games?
>>
>>61711490
>Use curl to download the html and grab what you need with regex.
Not that that's necessarily wrong but regexing html is usually insane.
>>
>>61716494
Yeah, I'm with you. That ain't going to be easy.

What would be way easier is if you could interact with the user's phone and have them scan/photograph the image. That would work much better if it's good enough for anon's purposes.
>>
>>61716494
Actually I just need it for Windows. But those options in this momment are a bit expensive for me.

Basicly I want this:
>user scanning documents inside the website
>system saves scanned file path in some column in table "Documents"
>user clicks in some button for file visualization
>system looks for path and open the file

Maybe in future I'll change saving file paths to saving the file in DB.

>>61716579
I saw some people taking this approach in Chrome OS until someone made a chrome extension. But for me it would be very time consuming for scanning 15 or more pages wich is a regular case in application my context.
>>
Anyone with a webdev related job that travels a lot for work? I kind of would like a job that requires me to travel around the world a lot but I feel like webdevs just sit behind their desk all day.
>>
>>61716775
>Maybe in future I'll change saving file paths to saving the file in DB.
Why?
>>
>>61716775
Does this absolutely need to be done with a website? Because it might be a lot easier to do with a native app, especially considering it's only on Windows. There are probably libraries available that would be easier to integrate into a native app than a web app.

>>61716579
This is actually easier than you might think; I looked into the options for a website I considered making recently.

You can get camera input and render it to an HTML5 canvas (and snapshot it) really easily on devices that support it.
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
https://davidwalsh.name/browser-camera

And on devices that don't, there's an option on HTML form inputs to launch the camera directly from the site, and directly upload a photo taken.
https://mobilehtml5.org/ts/?id=23

Combined with websockets, you could effectively connect a user's desktop session to their mobile device session and make it work pretty well.
>>
>>61716852
You're going to be sitting behind a desk regardless lol
>>
>>61716997
I don't know actually.
It's like a team project decision but I didn't measure the pros and cons with them. Sounds like a huge weight for DB tho.

>>61717036
Sadly yes. But this is a possibility too.
Also thank you for these informations.
>>
/g/ is surprisingly Luddite it's amazing
>>
Currently learning RoR to be employable, I'm sick of being an underpaid front-end dev, what should I do to be the most employable RoR dev? Learn TDD? Specialize myself into some specific gems? Jump on the ReactJS meme?
>>
>>61689007
Fucking webdev fags
>>
>>61717519
/dpt/ taking a break from programmer-waifus and Rust shitposting
>>
>>61717429
if you aren't building your own platform, there's zero need to learn rawr when any of the major companies eventually shift over to something maintainable
>>
File: Theraphosa-blondi.jpg (210KB, 1000x667px) Image search: [Google]
Theraphosa-blondi.jpg
210KB, 1000x667px
>>61713173
wise words from the eldar

>>61707579
Not him, however, I notice the influx on other boards too. Don't know its source, tho.

>>61706028
>>61706121
>>61706162
>>61706185
Are you by any means a carrier of a vagina? Anyways, >>>/r/eddit

>>61706316
Don't waste any more space here.
>>
>>61717594
Yeah right, people said that years ago but I've never seen more offers for RoR devs where I live, I know companies that literally recruits PHP devs and train them to RoR because it's just so hard to find.

RoR projects are here to stay, you have to be pretty delusional to think otherwise.
>>
>>61716852
You could find a remote position. That way you can travel where ever you want, as long as you get the hours done.
>>
am I retarded for using explicit return statements in my nodejs code? i see code like >>61715495
a lot, but I _always_ use return because I feel like its much safer. am i doing it wrong?
>>
>>61718080
for example
router.get('/products', function(req, res, next) {
return Product.find({}, function(err, products) {
return res.render('index', {
products: products
});
});
});
>>
I have an idea for part of my portfolio website. Basically, a list like pic related, but each item is an accordion that expands to reveal the challenge prompt and solution code. How do I make this a reality? I'm comfortable with C++, starting to get into algorithms/data structures now. I know a bit of HTML/CSS from "making websites" when I was younger, but almost no JS, and no clue about frameworks/libraries/etc. I found this https://www.w3schools.com/howto/howto_js_accordion.asp which I would be fine modifying, but it'd be cool if it could be more elegant than just all the code copy-pasted into the HTML. I'm not asking for a solution, just hints on what I should search for to learn more.
>>
>>61718099
If I understand currently, res. will automatically fulfill the return, so you don't have to explicitly return it. Of course, the Product.find would have to be returned though.
>>
>>61718322
nice picture, man
>>
File: serveimage.png (143KB, 600x600px) Image search: [Google]
serveimage.png
143KB, 600x600px
Do you suppose someone with working knowledge of general programming could go from 0 experience in web dev to creating a small but working and professional-looking website in the space of three weeks?
>>
>>61718508
Thanks, my dude.
>>61718322

>>61718681
Yes.
>>
>>61718878
just stack two divs, one for 'question' + questionNum, one for 'answer' + questionNum. Set answer display to none.

pass the questionNum to an onclick. Check if the question div is hidden, if it is, show it and hide answer. Otherwise do the opposite.
>>
A noter que elseif et else if sont traités de la même façon seulement quand des accolades sont utilisées, comme dans l'exemple ci-dessus. Quand vous utilisez ":" pour définir votre condition if/elseif, vous ne devez pas séparer else if en deux mots, sans quoi PHP soulèvera une erreur d'interprétation.
>>
>>61717158
>Sounds like a huge weight for DB tho
DBs are easily optimised for large binary data though and can usually store it compressed as well.
>>
File: tes.jpg (65KB, 1270x572px) Image search: [Google]
tes.jpg
65KB, 1270x572px
I know fuckall about coding or frameworks, here's a grocery list-type thing I'm working on. The actual list is stored on a mysql database and the view in pic related interacts with it through API calls

Whenever a create/update/delete call succeeds, I pull the entire grocery list from the database and paste that into the table markup. This feels really dumb and inefficient, what would be a better way of updating the view every time the database is altered?
>>
>>61720054
Add a time stamp column and do WHERE timestamp >= %timestamp value% or something
>>
Where is the border between js basics and advanced js? What exactly someone who has basic js knowledge should know? How do i check the level of my js knowledge?
>>
>>61720581
>Where is the border between js basics and advanced js?
Whether you feel like killing yourself or not.
>>
>>61720581
When you realize that you wrote a lot of legacy code.
>>
File: 1498771043117.png (116KB, 500x465px) Image search: [Google]
1498771043117.png
116KB, 500x465px
I inherited a codeigniter project from a team of pajeets and have been working on it for about a month.

Should I bother switching to a better framework? Give me any reasons and a good framework pls.
>>
>that fucking npm guy who typosquats and steals all your env variables
top kek
>>
>>61720928
yes, switch to vanilla javascript and css
>>
File: 1476230511376.png (81KB, 556x430px) Image search: [Google]
1476230511376.png
81KB, 556x430px
>>61700082
Tfw my boot runs from command line and makes me 45 dollars a day.
>>
>>61721294
unironically this
>>
>>61721294
so it will go from shit to shittier.
>>
>>61708632
it reacts to state changes out of the box with setState and componentDidUpdate
>>
>>61721438
it will go from frankenshitter to glorious ascended coding
>>
Should i bother with glitch.com for the backend peojects?
>>
File: 1301122190127.jpg (155KB, 583x782px) Image search: [Google]
1301122190127.jpg
155KB, 583x782px
>spend hundreds of hours making a website
>only make like $1000 from it
>>
>>61708632
What? No it doesn't. You could also just write your own state management system.
>>
File: 1501059736432.png (501KB, 1110x1080px) Image search: [Google]
1501059736432.png
501KB, 1110x1080px
>>61708632
>>61724272
isn't this what redux is for ?
>>
>>61724334
Yes, it does, but you could build your own state management if you really wanted. I prefer redux, myself. I really enjoy the whole React ecosystem. I recently started using GraphQL for messing around and it seems bretty gud.
>>
>>61724391
>GraphQL
i'm trying to understand wtf this new meme is
isn't its purpose the same as hateoas rest ?
>>
>>61689722
very nice dude
>>
File: SUPER_NUT.jpg (25KB, 287x284px) Image search: [Google]
SUPER_NUT.jpg
25KB, 287x284px
>>61723725
>spend dozens of hours making API for free under MIT-license
>it ends up putting the startup with the same idea out of business
>>
90% of the traffic to my website seems to come from third world countries that I don't earn anything from.
>>
File: 1494959883810.png (17KB, 344x135px) Image search: [Google]
1494959883810.png
17KB, 344x135px
>>61724574
>it ends up putting the startup with the same idea out of business
pls explain
>>
File: why is this allowed.png (14KB, 787x307px) Image search: [Google]
why is this allowed.png
14KB, 787x307px
WAKE ME UP
>>
I'm trying to learn PHP and Wordpress, so I'm making a theme. And I want to do something special in certain categories. For which I used a simple array:

if (in_category( array ('large-something', 'medium-something', 'small-something')))


But instead of mentioning every category individually, is it possible to select all categories that contains the word 'something'?
>>
>>61725291
Never mind, i found a solution:

$theurl = $_SERVER["REQUEST_URI"];
$urlcontainssomething = strpos($theurl, 'something');

if ($urlcontainssomething!==false) {
//url contains 'something'
}
>>
>>61725120
How is that a problem? Just use the final syntax and some autoprefixer to solve your issues.
>>
>>61725443
But now I'm wondering if this is vulnerable to injections.
>>
>>61725520
>some autoprefixer
the question is, which one?
>>
>>61726247
I'm using the gem of https://github.com/postcss/autoprefixer and I never had any issues with my flex rules. Tested most of the browsers with Browserstack.
Thread posts: 316
Thread images: 41


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