[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/wdg/ - Web Development General
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 17
File: wdg.png (4 MB, 2235x1500) Image search: [Google]
wdg.png
4 MB, 2235x1500
Last one reached 300

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

>Where to start
https://www.youtube.com/watch?v=JilfXmI2IjQ
https://www.youtube.com/watch?v=zXqs6X0lzKI

>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/

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

>Backend development
https://en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks
https://gist.github.com/dypsilon/5819528

>Useful tools
https://pastebin.com/q5nB1Npt/
https://libraries.io/ - Discover new open source libraries, modules and frameworks and keep track of ones you depend upon.

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

>How I Got a Job in Web Development
http://elliotec.com/how-i-got-a-job-in-web-development/
>>
I'm making a wesbite for some shitty theatre club.

How much do I make them pay me?
>>
>>50729719
dont make it perfect make imperfections into it that you can fix later else you wont make too much
>>
up, fam
>>
using datatables and trying to add links to my third column. However when I sue the "columns" identifier my table no longer loads. Why the hell is that happening?

$(document).ready(function() {

$('#medicine').DataTable( {

"processing": true,

"serverSide": true,

"ajax": "Medicine/test"



"columns": [
{ data: "HerbName" },
{ data: "HerbalDescription" },
{
data: null,
className: "center",
defaultContent: '<a href="" class="editor_edit">Edit</a> / <a href="" class="editor_remove">Delete</a>'
}
]

} );

} );

} );

>>
would anyone know how to get this nodeJS module to work?
var express = require("express");
var app = express();
var http = require("http").Server(app);


exports.createFile = function (file, port) {


app.get("/", function (req, res) {


exports.showIP = function () {
console.log(req.ip);
}


res.sendFile(file);


});


http.listen(port, function () {
console.log("server is up");
});


}
>>
>>50729747
What about having more than one client and having a better schedule (excepting weekends)?

>>50730513
There's an extra "} );". Google "javascript syntax highlighter" and "javascript linter"
>>50730688
exports goes on a separate file. I think you need to read the guides again.
>>
I've been using wordpress for about 3 hours now and I'm confident when I say that I welcome death.

No wonder people hate php, if WP is the first thing they encounter.
>>
>>50730930
Try Bedrock. However, there is no support for PHP 5.4-
>>
>>50730924
>>50730688
I'm aware, but that doesn't mean i can't include express in it. i just don't know how to get the exports.showIP to work on the other file/server
>>
>>50730513

so I fixed the JS error but I can't figure out how to properly create links in my third column using data.
I tried this:

          "columnsDefs":  [
{ "targets": 0 },
{ "targets": 1},
{
"targets": 2,
"data": "HerbName",
"render": function ( data, type, row ) {
return '<a href="'+data+'">Download</a>';
},


}
]


but there is no link to be seen. what am I missing in the code? the data comes from ym SQL call.
>>
rtaegergaergaerg
>>
Alright guys, so what do I actually learn if I want to delv into this? I've seen so many blog posts, articles that say learn PHP, then I see others say, "No learn Ruby", others say,"Python Django is better", "No Javascript is the bomb."

Someone please give me a good chronology for maximum reward.
>>
If evens, I'll support Edgelords.
>>
>>50731044

I'm close as hell to getting the linking to work but I can't figure out how to get the HerbName data I have from my columns as the data input for the link.

anyone know how I approach this with datatables?

code:

$(document).ready(function() {

var oTable =$('#medicine').DataTable( {

"processing": true,

"serverSide": true,

"ajax": "Medicine/test",



"columns": [
{ "data": "HerbName" },
{ "data": "HerbalDescription" },
{


"mRender": function ( data, type, full) {
return '<td><a href="Medicine/Herb/'+data+'" class="reject">edit</a></td>';
},


}
]


} );

} );
>>
},


}
]


} );

} );

why is this allowed?
>>
>>50731902
JAVASCRIPT
AVASCRIPT
VASCRIPT
ASCRIPT
SCRIPT
CRIPT
RIPT
IPT
PT
T
>>
>>50731945
>JAVASCRIPT
>AVASCRIPTJ
>VASCRIPTJA
>ASCRIPTJAV
>SCRIPTJAVA
>CRIPTJAVAS
>RIPTJAVASC
>IPTJAVASCR
>PTJAVASCRI
>TJAVASCRIP
>>
>>50731945
and people ask why I avoid it like plauge ridden dogs
>>
Some people just write ugly code. It's not Javascripts fault.
>>
File: 1435736297463.jpg (146 KB, 1520x1080) Image search: [Google]
1435736297463.jpg
146 KB, 1520x1080
>>50732073
>defending javascript
>>
>>50732085

$(document).ready(function() {

var mRender = function(data, type, full) {
return '<td><a href="Medicine/Herb/' + data
+ '" class="reject">edit</a></td>';
};

var oTable =$('#medicine').DataTable({
"processing": true,
"serverSide": true,
"ajax": "Medicine/test",
"columns": [
{"data": "HerbName"},
{"data": "HerbalDescription"},
{"mRender": mRender}
]
});

});
>>
>>50732101
...and?
>>
>>50732101
        ]   
});

});


JAVASCRIPT
AVASCRIPT
VASCRIPT
ASCRIPT
SCRIPT
CRIPT
RIPT
IPT
PT
T
PT
IPT
RIPT
CRIPT
SCRIPT
ASCRIPT
VASCRIPT
AVASCRIPT
JAVASCRIPT
>>
>>50732101
>>50732101

R O R

O

R
>>
quit bullying me
>>
>>50732156
ROR looks way better than this.
>>
Someone post code and I'll tell you why it's shit.
>>
>>50732182
what code isnt shit?
>inb4 ASM
>>
>>50732201
Mine. :^)
>>
>>50732182
$string = 'JAVASCRIPT';
$strlen = strlen($string);
echo $string , '<br>';
for ($i = 1; $i < $strlen; $i++)
{
echo substr($string, $i) , '<br>';
}
>>
What's everyone working on?

I'm making a static blog engine while learning Flask.

I've never used a static blog generator before, so I don't really know what features to include, but it seems pretty basic
>>
>>50732182
puts "hello world"
>>
>>50732159
Are you the same Anonymous, or a new one?
>>
>>50732228
trying to fucking learn js and i HATE IT
>>
File: controls.webm (265 KB, 486x500) Image search: [Google]
controls.webm
265 KB, 486x500
>>50732228
Livestream controls and shitposting.
>>
>>50732244
avoid it. learn PHP, Ruby and git.gud at CSS instead. unless you want to work for a company, then you are fucked.
>>
>>50732269
>unless you want to work for a company, then you are fucked.
I do. I want to make a living wage. I don't know if that would be as possible doing freelance stuff here and there.
>>
>>50732244
>>50732311
Yeah, majority of Js blows, and it sucks that its so necessary. I found backend to be good because I can mostly avoid JavaScript.

>>50732257
Custom streaming site? Nice, what language?
>>
>>50732244
something javascript good parts pdf something
>>
>>50732326
Backend is Node.js right now.
>>
>>50732399
gross...
>js
>backend
why?
>>
>>50732493
Because matroska has an unusable EBML library.
>>
>>50732546
I really want to agure, i just...
i cant.
>>
I asked this before, but I'll ask again anyway... what are pros and cons for making a single page website with page transitions and almost no JS code? It's a small website, I just need a few forms, one per page, plus the obvious about/contact pages

I've been told that it could be bad for SEO, but google says otherwise. also, searching will show results from the hidden divs.

what worries me the most about CSS3 shit is accesibility...
>>
>>50732577
Shit just works fam. I may switch to another backend, but it hasn't been an issue yet.
>>
>>50732581
>pro
simplicity
>con
security
welcome to programming.
>>
>>50732595
to each his own. I always try to remove js from my projects no matter what, i just cant stand working with it.
>>
>>50732597
wut? how is this bad for security?
tympanus.net/Tutorials/CSS3PageTransitions/index.html
>>
>>50732581
>single page website with page transitions and almost no JS code?
by this I mean something like >>50732625 , without JS

>>50732597
I guess I should have explained this
>>
>>50732625
sorry i must have read that wrong. I like CSS3 transitions. js can be used to xss so thats what my point was but i gueff it was literally who.
>>
How long have you been in these threads lads?

I remember first coming here in like early march or late february when there were no links in OP, just "what are you working on /g/"

https://warosu.org/g/thread/S46746407

Uhh.. Those we're simpler times...
>>
>>50732699
I think around early January/February. I remember I was in school at the time.

Thankfully the general shitposting hasn't gone up terribly.
>>
>>50731945
>>50731974
>>50732143
I wonder if this works
JAVASCRIPT JAVASCRIPT
AVASCRIPT AVASCRIPT
VASCRIPT VASCRIPT
ASCRIPT ASCRIPT
SCRIPT SCRIPT
CRIPT CRIPT
RIPT RIPT
IPT IPT
PT PT
T T

T T
PT PT
IPT IPT
RIPT RIPT
CRIPT CRIPT
SCRIPT SCRIPT
ASCRIPT ASCRIPT
VASCRIPT VASCRIPT
AVASCRIPT AVASCRIPT
JAVASCRIPT JAVASCRIPT

JAVASCRIPT JAVASCRIPT
AVASCRIPT AVASCRIPT
VASCRIPT VASCRIPT
ASCRIPT ASCRIPT
SCRIPT SCRIPT
CRIPT CRIPT
RIPT RIPT
IPT IPT
PT PT
T T

T T
PT PT
IPT IPT
RIPT RIPT
CRIPT CRIPT
SCRIPT SCRIPT
ASCRIPT ASCRIPT
VASCRIPT VASCRIPT
AVASCRIPT AVASCRIPT
JAVASCRIPT JAVASCRIPT
>>
>>50732699
i remember those times
/wdg/ hasnt gone down hill as much as some of the boards around here so im rather thankful for that. I generally come to /g/ for this an /flt/ now becaue my skyrocket 2 still works.
>>
>>50731310
Check this out https://youtu.be/pB0WvcxTbCA
>>
>>50732699
I like this general. Web development is actually fun. Been programming for almost 5 years and it's nice working on something that actually gets used.
>>
>>50732218
>php
>>
Upgrading a 20k lines Angular project from 1.2.28 to 1.4.7.

Without tests.

Written by people who have not done Angular before.

Kill me.
>>
>>50733927
>20,000 lines of Angular

This is the new generation of web developers, ladies and gentlemen.
>>
>>50733927
>Angular
I'm sorry
>>
Btw has anyone read https://survivejs.com/ ?

I was thinking about purchasing it for leet hipster webdev skills but I'm not sure whether it's good or crap.
>>
>>50732581
anyone else has something to add?

>>50732699
some months only... I wasn't interested in webdev until a few weeks
>>
>>50732581
Do it. I fucking hate developers who make me enable Javascript just for formatting their web page. It's absolutely retarded.
>>
>>50733966
Large SPAs are not bad if they have been modularized correctly and the programmers who create them know what they're doing. I prefer client-side rendering to server-side if the nature of the application is such that the ux suffers from page loads.
>>
so ive just started learning angular, and I finally got it working with codeigniter. im still on practice stage before you suggest another framework.

is there any reason a lazyload plugin wouldn't work with a spa? or any scripts that modify the page on load?

another is preventing ondragstart, works fine with images outside the spa, but doesnt register anything inside
>>
>>50734022
This is a bad argument. JS (not CSS) is for functionality although it should not be required for basic things. Those developers are bad.
>>
>>50734228
Format is different from function and CSS is god tier in the hands of someone clever.
>>
>>50734171
alright i added an onclick event and tried after the page and its view had loaded entirely. that worked.

its a page loading thing. is there a way to set specific scripts to act on angularjs's view load rather than the page? or do i need to set a delay (i dont want o do that)
>>
what free editor does /wdg/ use?
>>
>>50734503
sublime text for the most part

has some ridiculously cool addons
>>
>>50734503
I use Atom for everything
It's like Sublime but free
>>
>>50734503
I'm dumb and tinker with shit.
>vim mostly
>st3
>spacemacs for orgmode
>>
Daily reminder that Elixir is the future.
>>
Any thoughts on meteor? Thinking of learning it but not sure if it really has a future.
>>
>>50735223
It's getting a lot of love and will get even more when it has native support for postgresql. Definitely has a future.
>>
For those who have completed the codecademy course on JavaScript, how much does it cover? Do you have a working knowledge of the language after completing?
>>
>>50735326
ye
>>
>>50733974
>purchasing something that is freely available on github
what the actual fuck is wrong with some people?
>>
>>50734228
How are you expected to write interactive web software without having to refresh the page every 3 seconds then?
>>
>>50732597
You faggots aren't programmers. You just use a pussy markup language. Go learn C++, then you can actually be a programmer. Shit, people who use python are more of a programmer than you.
>>
>>50736074
>he's never written a highly interactive web application
>>
>>50736074
>he's never written a web application
>>
>>50736041
Javascript for functionality is good.
Javascript for formatting is bad.
>>
>>50736074
butthurt NEET detected
>>
>>50736074
Anybody who writes with Javascript is a programmer.
>>
>>50736122
True, but there are some things that can not be done in CSS. For example translate does not adjust the background position of the element. Need to use JS for that.
>>
>>50736148
I trust your judgement fam. It's the other guys.
>>
>>50732699
I was here for the first thread I think. Remember somebody asking about IRC, then we had an IRC channel. I feel like poeple who actually get jobs leave, so we mostly have inexperienced peopel.
>>
Isn't it amusing how web development is actually pretty tough? A non-trivial web application involves so many things, yet for some reason this field attracts all kinds of retards who don't even know how HTTP works, especially on the front-end.
>>
>>50736144
>>50736127
>>50736114
>>50736104
Keep telling yourself that.
>>
>>50736414
The definition of computer programmer is one who uses a Turing complete language to implement software algorithms.
>>
>>50736414
I learned C++ as my first language so get rekt.

Anyone know of any simple angular apps I can look at?
>>
>>50736414
Have you actually ever used Javascript?
>>
>be okay with js
>decide to read eloquent js to see what the hoopla is about
>get to chapter 3, seems kind of weird
>get to chapter 4 and it reads like some CS book
Why the fuck would you ever go this route? I've made a ton of stuff and never required anything like this to get them working.
>>
I have a FOSS project that some non-technical people are interested in deploying. How much should I be charging for installation and sysadministration (VPS, etc. costs not included)?
>>
upvoting this general
>>
I just started a big project in Django. Am I fucked?
>>
>>50732244
Just use jQuery like the rest of the world
>>
>>50736452
Lookup TodoMVC, it has a bunch of examples and there is an Angular example as well
>>
I'm starting to use Git more often, but I still have the bad practice of not commiting often.

Obviously I should commit when I fix a bug, but when else? I don't want to commit half finished work
>>
>>50739777
break down your feature into smaller branches.

let's say you have a blog website and you're implementing commenting feature

create one branch called comments
break down comments into three other branches, comments model, comments front end, comments controller etc. basically, contain every part of the feature to its own branch.

What I often see is people creating a single branch and then writing 3000 lines of code in it and then merging with master, this in general is a bad practice because it becomes hard to isolate parts of the code to find bugs or to re implement some feature.
>>
>>50739964
Alright, I kind of get it.

I have a 'development' branch going, where I am just adding basics to this project. After I get a chunk done, like a tagging system (blog), then I will commit it, but you're right, I should commit in smaller chunks.

I haven't even thought about making even smaller branches
>>
>>50739777
do a commit every time you make a change, even if it's just deleting one character to fix something
>>
>>50739521
yes. now suffer the consequences of duck typing
>>
I am making a nodeJS module
and i need to include a function inside app.get();
how do i make it so i can call this function on my actual application, and or server.
var express = require("express");
var app = express();

app.get("/", function (req, res) {
exports.type = function () {
console.log(req.ip);
}
});
>>
>>50739777
Don't be afraid to commit half-finished work, just use git-rebase -i to merge the commits into something more coherent before pushing them out.
>>
>>50729617
Currently working on redesigning my company's entire web infrastructure. Right now we have a website run half with an old but well-designed Perl system, half with Drupal 5, and half with Drupal 7 (~200 modules installed, about 30 custom). No one's actually sure which parts make the whole. We run several sites off the same Drupal install, and just theme them differently. We use mostly MySQL, but also some Mongo in places. There's some REST-ish APIs running with Python w/ Werkzeug, most old and out-of-date (but we don't know which parts). We have iOS & Android mobile apps but no developers, and we lost the password to the signing key for Android. We also have some heavy backend stuff with dæmons that crash or silently stop working all the time. Our webservers run both Apache & nginx. We have some server redundancy but none of it is actually failover except the webservers (if one load balancer fails the other stops working; DB machine(!) has replica(s) but they need to be brought online manually).

We kind of inherited a mess. So I'm working on identifying our services so we can put them behind an API resting on mod_python. We break out the sites using Drupal multisite, and re-do all our custom modules to talk to the API instead of the databases directly. Mobile apps (using Ionic or something like that) will use the same API. The API then talks to the database servers, hopefully clustered — I'd like to go with Postgres but we'll probably go with MySQL Cluster or Proxy for now. We just bought a new dev machine (VM host) with some spare budget; it comes in on Monday so the first thing I'm going to do is set up a proof-of-concept for some of this stuff.
>>
dcddddddddddddddd
>>
>>50737998
About £50/hr. £75-100 if you live in a big expensive city.
>>
>>50740458
Sounds good. I've never used version control before, but I'm trying to get in the hang of it.

>>50740966
True enough, yeah. I've been looking around at proper ways to use version control, and some will say "Don't commit work that isn't done", but I forget about Git rebase.

Thanks again
>>
>friend says he wants his site to not have to modify HTML directly when he changes one part of it occasionally
>importing angular.js to do that
>>
>>50741547
wait, what?

What kind of site is it? You could just render Markdown and link that with a CSS sheet, and basically never has to look at HTML, and you never have to look at Javascript
>>
Perhaps I'm being silly but:
Is it possible to have a csv file with info about different products per row (description, features, url to an image) and have the csv sitting in the root with a static html page per product which display the details from the csv?

I know a database would be the logical solution however I already have the rest of the site built and would like the site to be as static as possible, I also have the csv.

what I mean is:
Div1 shows title from Column 1 row 1 of the csv, div2 the description from Column 2 row 1, and so on for 500 products and 500 static pages.

So I can then just maintain the csv and the pages will update automatically
>>
>>50741882
send it as a page resource & parse it with jquery
>>
>>50741680
>render Markdown
what do you mean? It is a regular html,css, js site.
>>
I want to build a web app where people can post photos and assume that there will be a lot of them. How to deal with photos? I am using ORM database so should I put them into it or what?
>>
>>50743364
save the photos on the filesystem and then save the path to the photo in the database
>>
>>50732595
>censors out web address
>leaves logomark in full view
wew
>>
>>50742779
You said he doesn't want to fiddle with HTML right?

I've been playing around with making a static blog site, and it uses Markdown at the markup language, so its not a hassle to fiddle with.

So if its a static site, you could look into Markdown rendering and it would be easier on him to modify the pages
>>
>>50743519
link to this markup you speak of?
>>
>>50740927
what are you actually trying to do?
>>
>>50743364
>>50743506
I hear many people put images inside the DB as binary blobs. Is that something windows devs do, because NTFS performance is shit? Don't see any other reason to.
>>50740927
See >>50743592
>>
>>50743663
There are two advantages to storing it as binary inside the database.
1. You wont ever have a row that points to a bad path.
2. You can just copy the database and the files will be copied too.
There are two disadvantages
1. Its not scalable.
2. Its fucking retarded.
>>
>>50743513
Still prototyping. I post the github whenever someone asks.
>>
>>50743557
nvm got it. so I have to install the required gems on the server then it will convert the markdown to html? it says it doesn't really support tables, but some versions do (wtf). It might be useful
>>
>>50743774
post eet
>>
File: repo.png (2 KB, 220x18) Image search: [Google]
repo.png
2 KB, 220x18
>>50743888
Don't hack me fam.
>>
>>50743663
>>50743769
I remember reading a postmortem about storing photos in MySQL recently, let me find it... Here tinyurl: 2wmhx2
>>
>>50743592
im trying to make an api, which i can call from another file.
>>
>>50743935
http://www.sitepoint.com/understanding-module-exports-exports-node-js/
>>
>>50743905
I know nothing of node. Does the example expect me to be running a media server on port 9001? How does it get the file to serve?
>>
is there a language-agnostic MVC tutorial? or at least not a shit one...
I wanted to use django. I followed the tutorial and I think I learned something, but... never applied, and now I'm using Go instead. the problem is that, in Go, its libs 3rd party libs, assume you know this shit, while I don't really know much.

also, I know some basic JS... should I really learn node.js ? should I relearn everything? is there a node.js tutorial for java/c/python programmers?
>>
>>50744090
oh, and btw, I'm a sloppy programmer...
>>
>>50744090
go learnt he ruby on rails one by michael hartl and you shoudl gain enoigh knowledeg 4that apples to othe rlangues xd
>>
I've constructed a function in Javascript which checks if a value is classified as a boolean primitive. If it is, it returns true, otherwise it returns false.

Through the use of deep comparison ("==="), I filter out all the types of values that would have to be coerced before they could be true or false (i.e. they are not "true" boolean primitives like true or false).

However, the part that confuses me is that NaN should (and does, in my function) return true. That is, NaN should pass the check determining whether or not it is a boolean primitive. Why is that? Is NaN actually a boolean primitive value? I thought it would have needed to be coerced before it could be considered true or false.

function boo(bool) {

if(bool === true || bool === false){
return true;
} else {
return false;
}
}

boo(null);
>>
>>50744060
It's all in the README. Basically you feed a file to FFmpeg and have it spit it's output to port 9001 where it gets prepared for browser. Post an issue on gitcuck if you're still having trouble.
>>
>>50744183
why do u have that if statement
u can simply return bool === true || bool === false

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN
>>
>>50744225
I'm a scrublord at programming, innit
>>
>>50683007
Then don't plug in the Ethernet or set up the WiFi. Done. It's dumb. >>50735272

It'd be godtier imo with native relational database support.
>>
>>50744144
thanks fam
>>
>>50744210
Is that how node projects are developed? Interchangeable microservices? Is this what is known as "middleware"?
>>
>>50744538
You may be on to something.
>>
>>50744183

return typeof bool == 'boolean'
>>
Why does PHP not die? Why is it still chosen for some new projects? Why is Symfony (as the complete framework) ever chosen? It's so fucking verbose, I guess even Java EE would require you to make adjustments in fewer places to get stuff done.
>>
Some questions on codeigniter:

1. how the fuck do I remove the need for index.php in my urls using Apache 2.4.10? fucking thing keeps breaking

2. For some reason when I load a controller function within my controller it tacks on the controller name for instance:

            $this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->load->model('HerbModel');
$herb = $this->uri->segment(3);
$this->HerbModel->deleteherb($herb);
$this->index();


creates a URL: index.php/Controller/Controller

causing my Datatable to crash horribly. What the shit is happening here? Could it be from me trying to take out index.php?
>>
>>50744848
Because it's one of the most accessible languages for doing web programming. And once PHP 7 comes out, it will be a serious contender for web performance.
>>
>>50744879
You need to configure Apache to read it
http://www.htaccess-guide.com/directoryindex-uses/
>>
>>50744903
Meanwhile, companies are still on 5.2 and 5.3. Maybe in 2020 or something will we be seeing demand for PHP 7.
Hopefully before that happens, sensible companies will have switched to Hack.
Or even C#.
>>
>>50744879

samefag for the 2nd question could this be caused by my calls to css sheets via websites??

this is the code I call in my view files and people have said that .css can sometimes fuck with the URL creating a fucked load.


<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.9/css/jquery.dataTables.css">

<!-- jQuery -->
<script type="text/javascript" charset="utf8" src="//code.jquery.com/jquery-1.11.3.min.js"></script>

<!-- DataTables -->
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.9/js/jquery.dataTables.js"></script>
>>
I am trying to play an audio file on my server with aurora.js,
but it's just complaining that:
ReferenceError: AV is not defined.
Anyone know what the problem is?
Something I am doing wrong?

<html>

<head>
<title>test</title>
<script type="text/javascript" src="elm.js"></script>
<script src="https://github.com/audiocogs/aurora.js/releases/download/v0.4.4/aurora.js" type="text/javascript"></script>
<script src="https://github.com/audiocogs/mp3.js/releases/download/v0.1.0/mp3.js" type="text/javascript"></script>
</head>

<body>
<div id="todo" style="width:100%; height:100%;"></div>
</body>

<script type="text/javascript">
var div = document.getElementById('todo');
var todo = Elm.embed(Elm.Todo, div);

var player = AV.Player.fromURL('http://127.0.0.1:8000/static/files/02%20-%20Teleportation.mp3');

</script>

</html>
>>
Is this require.js AMD module stuff even used in websites or is it only for node applications?

I've never seen anyone do anything but dump a ton of JS files into their websites. Wouldn't asynchronously loading required JS files on every request kill performance?
>>
There might be too many *.js's
>>
>>50745113
from the Aurora README

<code>
var AV = require('av');
require('mp3');
</code>
>>
>>50745225
we need moar js
>>
>>50745141
Yes, it's widely used. No, the way you're supposed to use AMD is loading code only when you need it. For example, let's say you have a custom app that has a place where you can take notes..

You could choose to not load the modules the notes part requires (maybe a rich text library like CodeMirror) until the user clicks on the notes section.
>>
>>50745236
thanks,
don't know how I've missed that...
>>
>>50745113
>>50745292
>>50745236
Well, now I am getting the error:
ReferenceError: require is not defined

Require seems to be only a Node thing?
I am using a prebuilt version of aurora, and I read that normal <script> tags are sufficient for including it.
https://github.com/audiocogs/aurora.js/wiki/Getting-Started

Does anyone know more about it?
>>
>>50745088

the url I get is this:


http://localhost:8080/newjob/index.php/Medicine/Medicine/test?draw=1&columns%5B0%5D%5Bdata%5D=HerbName&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=HerbalDescription&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=HerbName&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1444518797930

how can my controller be called twice? I'm very confused.
>>
>>50745562
That's a big URL.
>>
>>50745623

it's generated by Datatables.net for the most part and the user sees this URL:

http://localhost:8080/newjob/index.php/Medicine/Herbupload

which was the caller function that called my index file in the Medicine controller.

but for some reason it tacks on the extra Medicine controller to the URL that is sent to the JSON. Which is what is causing the error. But I don't know how to fix it.
>>
>>50745449
Got it to work (the provided libraries were just somehow wrong, or I misunderstood something),
but now the next weird thing happened,
firefox is sending thousands of requests for the to be played file, which all return 416 errors.
Chromium is not having this problem.
I have no fucking clue why, or even where I should even file a bug-report.
>>
>>50745987
make it not play at start up
>>
>>50745683

so I fixed the part with the data table not loading by converting my javascripts ajax call to:

"ajax": "<?php echo base_url(); ?>index.php/Medicine/test",

however when I do an action in another form that routes back to the datatables form the old URL is still in the address bar.

so for instance I call the DeleteHerb() for a herb from my Medicine Controller and the URL is this:

http://localhost:8080/newjob/index.php/Medicine/DeleteHerb/asasdsddsa

whent he deleteherb action is done it calls
$this->index() to load the datatables page but the URL stays the same instead of converting to:
http://localhost:8080/newjob/index.php/Medicine

why the hell is that happening?
>>
>>50746104
you probably fucked up your controller logic
>>
any tips on pentesting javascript applications with alot of ajax calls?
>>
>>50746047
what do you mean?
The first few packets actually arrive, and the song starts,
but then it just keeps requesting more and more.
The ending of the song is cut off though.
My guess is, that it requests too much data, and the server just tells it that it can't access more than the file, but firefox or aurora just keep on requesting anyway.
>>
>>50746143
wait 1 second and then start the song
>>
hi, i want to load a simple htm file from my own server into a page. im using jquery .load() to fetch it and it works, the problem is, i cant deal with it as a DOM object. Why is this happening?

  $( '#content .document' ).load( "src/p"+paperNumber+".htm", function() {
alert( "Load was performed." );
});
.
>>
>>50746180
Doesn't change anything.
The requests also keep going after I have pressed the pause button in the debug window, while the song actually pauses.
These requests also slow down the whole rest of the browser.
My hatred for firefox is growing day by day.
>>
>>50746202
try adding ".html" isntead of ".htm"

>>50746417
there is probably something wrong with your code and chrome just handles the error so it doesn't fk teh browser
>>
>>50746537
Well, if you think there is an error with my code please point it out to me.
Here is everything:
<html>

<head>
<title>test/title>
<script type="text/javascript" src="elm.js"></script>
<script src="http://audiocogs.org/codecs/js/aurora.js" type="text/javascript"></script>
<script src="http://audiocogs.org/codecs/js/flac.js" type="text/javascript"></script>
<script src="http://audiocogs.org/codecs/js/mp3.js" type="text/javascript"></script>
<script src="http://audiocogs.org/codecs/js/alac.js" type="text/javascript"></script>
<script src="" type="text/javascript"></script>
</head>

<body>
<div id="todo" style="width:100%; height:100%;"></div>
</body>

<script type="text/javascript">

var player = AV.Player.fromURL('http://127.0.0.1:8000/static/files/02%20-%20Teleportation.mp3');
setTimeout(function() { player.play();}, 10000);


</script>

</html>


There might be a problem with aurora.js,
but even after pausing the code in the debug menu, the requests still keep going.
>>
>>50746537
the file is a .htm file
>>
SELECT * FROM posts WHERE board = 'test' AND (reply_to = 1 OR reply_to = 2 OR reply_to = 3) ORDER BY time


How would I make it so this only returns the latest 10 rows for each value of reply_to?
>>
What's the best way to export an object as a string? I created an object called "data", then filled it with prototypes. I want people to export and import all the information from this variable.
>>
>>50748332
what?
>>50746202
huh?
>>
>take a webdev class after 3 years of C, C#, and Java based OOP and CS classes
>try to make anything with JS

What the actual fuck is this shit. Like seriously, how does anyone do anything with this? Is there a guide to learning a scripting language? I just can't get my head around using var and function for fucking everything
>>
>>50748901
You'll probably have to dick around with it for a few days/weeks/months before you figure out a sensible structure for Javascript. It took me about a month of jumping from your background to web dev.
>>
>>50748901
Yeah, javascript is a pain. welcome to the wonderful word of dynamic typing. But! You now have access to functional programing. Take this as an opportunity to do fun functional things.
>>
>>50732228
working on some project for work
>tfw no experience aside from some dabbling in PHP
>this project needs to be done in 3 weeks and it needs to be secure
just fuck my shit up
>>
>>50749009
Typical mangent disfunction. Engineering needs to set the schedule, otherwise the project is headed for failure.
>>
>>50749050
This internship is shit, I hate it. But I committed to 3 semesters of it bc of my college's program. I've considered driving off a bridge instead of continuing multiple times. It's not even in my field of focus
>>
>>50749122
I dont know your exact situation, but here are my general advice.
1. If you want to go into software/programing, then doing a programing internship will help you get a much better job after graduating. I would also say you should stick with this job if you are at least somewhat interested in programming, because it will tell you if you want to do it long term.
2. If you dont want to go into programing, you are more or less wasting your time. Seriously. If this is the case, you should talk to your class counselors about changing. It is much more productive to do something you care about. Remember - you can do literally whatever you want. I would strongly recommend changing jobs even if it means delaying graduation.
>>
>>50748901
php is gonna be easier if you have c like oop background.
>>
>>50749335
OOP is fine in js, you just need to pick a style of inheritance and stick with it.
>>
How do you work your resume for developer jobs if you have no professional experience or CS education, but you know what you are doing and have a portfolio?
>>
>>50749540

>a style of inheritance

lol wut. You either inherit or you don't. I'm confused.
>>
>>50751695

post your work and we'll let you know if you know what you're doing
>>
>>50730930
I was hired into a team to do web development at a small business near my home and my job is wordpress. The lead developer barely knows javascript, knows no python and they outsource any sort of app development . The development consists of buying themes for wordpress and filling in content. Is this my reality. Will it ever get better?
>>
>>50752319

don't accept jobs at companies who use word press. Does even count as being a "web developer"? lel
>>
>>50752319
Also macs as far as the eye can see. I'm not necessarily complaining, I prefer it over windows, but they are using some expensive technology to handle some very inexpensive tasks. For instance there's a macbook pro in the office who's sole purpose is to function as "cloud storage". It's just houses some shared folders. And there's a mac mini that powers a slideshow on a tv when you walk in. I would suggest they use a rasp pi or just have the fucking "cloud" server airplay the slideshow to it, but i don't want to ruffle feathers.
>>
>>50752423
Don't ruffle their feathers. It's obvious that they have no clue and it's their own money (their investor's money) that they're wasting. Just get all the experience you need from that job and just make sure you get your weekly wage.
>>
lel
>>
>>50734503
vim.
>>
>>50734503
Emacs
>>
k
>>
>>50737865
>start learning how to program
>get to strings and If()then{} statements
>get past that and they start introducing all sorts of random shit
Why the fuck would you ever not use strings and if statements? I've made a ton of stuff and never required anything like this to get them working
>>
>>50753085
Efficiency.
>>
>>50753085
a coworker did that once.
his task was based on 3 combined choices there needs to be a specific output.

When the task was to add a 4th choice, he said it's not possible because it's too complex.

I ended up finding 800000 lines of code with if conditions covering all combinations.
He was fired the same day.
>>
who here has teh lelz for teh lelz?

lel
>>
>>50753148
pls say you screenshotted that ungodly mess
if there was ever an example of graduate meme guy then this was it
>>
>>50753694
it's still in source control.
but the strings might give away the company, so I'm not making a screenshot of it.
>>
>>50753923
ROT13 the strings then.
>>
I hate PHP and I hate JS but I like JS more. Whats a good DB for backend JS? I keep seeing mongoDB.
>>
>>50753923
Blur the screenshot, the shape of the code will tell us all we need to know.
>>
>>50754026
"It's simple enough and doesn't require an extensive database structure"
- Redis
"It DOES need an extensive database structure"
- *SQL (Postgresql, MySQL).
>>
Hey guys, I have one idea and I'm wondering if it is possible to do. If not, it would be cool to create one day. Is there a way to detect an audio playing on a page and manipulate its data to create soundwave representation with canvas element or in some other way? You know when the audio is playing, it puts a speaker on a tab. So I'm wondering if it has the ability to pull that audio data from a, for example, song playing in a youtube iframe. I wanted to put it in one forum header, when users play a song in youtube player they can watch the realtime soundwave representation of that song inside of a canvas element in the header.
>>
>>50754300
btw from what i managed to find, it is very hard to do, if not impossible. fuck technology, i feel like i live in a stone age, it cant do anything i want. reeeeeeeeeeeeeee
>>
>>50754026
don't do mongodb if you actually want to keep your data
>>
hey /wdg/, i use firefox on ubuntu with ad block edge as my "add blocker", just did a re-install and have found ad block edge isn't working. should i stay with firefox and use a different blocker, or should i move browsers? i don't really care as long as i don't get these youtube adds.
>>
File: webhelp.jpg (142 KB, 655x896) Image search: [Google]
webhelp.jpg
142 KB, 655x896
Hello /wdg/

Having this simple little problem I can't seem to find a solution for. How do I keep this "credits" container/div at the bottom of the page at all times regardless of the size of the content above it to push it down? On this page there is little content so it just goes up and creates this gap under it. Whereas on pages where there's enough content where I can scroll all the way down it sits at the bottom perfectly which is what I want for all pages regardless of how much content.

How do I solve it? I tried all "position: example;" in CSS for it but no good result yet. Hope you can help.
>>
>>50755292
http://ryanfait.com/sticky-footer/
>>
Why is webdev looked down on? If you exclude the big 4, salaries for software engineers are similar to, let's say, ror developers. Why do people belittle webdevs?
>>
>>50755378
It's easy as shit and usually done poorly.
>>
So assuming I have extremely little programming experience and only some Linux experience, is it good path to go through the front end books on the github page in the sticky? And lets say I learn at a regular pace how long should it take for me to be competent enough for a remote job (I'm not expecting any miracles or anything I'm just wondering).

Is there a more structured path I can take instead of having to rely on intuition as to what the next step is once I complete something?
>>
>>50755351
Thanks! It worked
>>
>Not doing ES6
>>
>>50755967
*ES2015
>>
>>50755378
multitude of reasons. to stay terse, the rise of the software startup (of which an essay can be written) has created an insatiable demand for web developers. such a demand is still not being met (for various other reasons that i wont get into). as such, numerous resources (with varying levels of effectiveness) have sprung up to satisfy a base level of competence to make it in the field.

like everything else, these "developers" and their skill levels fall within in a normal distribution. and since we're dealing with javascript only, many people have gotten creative (in a bad way) to get this language to do things it has no business doing (i.e. node). these tools, plugins, and the dependency hell that they all result in are made by developers without a formal CS background. as such, there's A LOT of junk out there, and there's not much one can do about it except use these tools if you want to make it in an industry.

and then there's other shit like "devops", another abomination, which i wont go into, but yeah that's a quick and dirty explanation.
>>
What is some good free text editor for linux?
>>
>>50756133
Vim.
>>
>>50747799
MySQL?
SELECT * FROM posts WHERE board = 'test' AND (reply_to = 1 OR reply_to = 2 OR reply_to = 3) LIMIT 10 ORDER BY time
>>
>>50756162
Not him, but wouldn't that just return ten results in total?
>>
Daily reminder that Elixir/Phoenix is the future.
>>
>>spend 10 minutes trying to debug javascript before realising i turned it off for testing
>>
>>50756383
Yes it would.

I would honestly just make 3 separate queries though. SQL isn't really the best place to implement your logic. It's way faster to just make the query for all the data, and massage/parse it server side when it returns.

Although I'm sure if you needed to do it in one, something like a nested select would probably be necessary.
>>
>>50756708
>query for all the data

So, you want to load 2 million rows into memory and then sort server side?
>>
>>50752186
Classical vs Prototypal inheritance. Javascript is a prototypal language unlike most others where you instaltiate and extend from classes.
>>
>>50756940
But the database is optimized to do exactly this.
Some shitty server side language might even choke loading it.
I don't want to even think about querying/sorting with it.

If your database is properly indexed, doing LIMIT/TOP should be no problem at all
>>
Deleted my post because I can't fucking speel gud

>>50756840
Unless you've got a shit connection why not?
Your DB isn't magically doing less work just because your query returns less data. It's still has to iterate, match the conditions, and do its pruning. Further, the DB is typically going to be slower at handling anything but simple queries unless you've got fancy shit going on.

If you actually do have a shitty connection, then yeah, you don't want to be waiting for all that data to get back, so I don't know what to tell you.
If you've got access to the DB maybe create a view or something for that shit.

Otherwise do the three separate queries.
It's not code golf.
>>
>>50756998
How can databases to be so shit at their only job?
>>
>>50756987
They're not optimized to handle complex operations like conditional conditions.

Essentially what it's going to do either way you slice it is go through the table 3 times to make sure it's got the first 10 reply_to=1, then the first 10 for reply_to=2, etc.

If you can set up indexes, than your best best is still to make the query 3 times and union.

See:
percona.com/blog/2006/08/10/using-union-to-implement-loose-index-scan-to-mysql/
>>
>>50757108
Their job is to read/write data, not to parse it.
You can configure your specific database to be better at all kinds of things, but in general they are there to compartmentalize and persist things.
>>
>>50757244
How difficult is it for the OS to send a ton of data between processes? Does it matter whether you use sockets, shared memory or fifos (or whatever options you have).

I mean,having to transfer tons of data at many requests per second, just to throw them away immediately afterward seems incredibly wasteful.
>>
Nice to see fellow webheads. Teaching a html and CSS basics course at a public library in the next few weeks. If there is one thing I teach them to make them not be shitty what should it be?
>>
>>50757290
Box model.

Also probably the flexbox equivalent of that. Don't do much frontend these days so don't know how that works but I'm guessing it's different enough from the box model to require a separate lesson.
>>
>>50757276
That concern is entirely valid.

There's obviously a limit when you're getting too much data back, that it becomes a burden. This can be especially dangerous if your query is called a lot. You would blow your server up. Unfortunately, that exact limit on when you should prune your data server side, vs DB side, will depend on a lot of different things. So I can't really advise you on what you should do other than try it both ways and see which one works.

I don't really know the nature of your data, but I just assumed because you're posting on a malaysian finger painting forum, it can't be that big and it would be silly to over complicate things at that level. I could be wrong though.
>>
>>50757369
Yeah it does. I'll try to get them into flexbox in the last day of css
>>
>>50754083
Is redis reliable enough to use as a primary database? I dont trust it to keep my data after a crash. I keep everything in a sql database and cache the most frequently-used values in redis.
>>
>>50756089
i'd want to hear about devops from you anon.
>>
Is there any good PHP library for data structures? The default array can suck my fucking cock. the next time I have to write array_filter, array_map or a usort and have to guess the order of the faggot parameters again I will definitely murder someone.

Doctrine's arraycollection is just as much an abomination as the regular PHP "array", except it at least has some methods (but far from all).
I heard Laravel has interesting collections, but I don't think they are available as individual Composer packages, are they?
The PHP SPL is completely unusable, too, but that's just what happens when you let a bunch of incompetent PHP shitheads attempt to clone parts of the Java standard library in a jewish toy language. And since the devs have just voted against a short lambda syntax for 7.1, even the best standard library wouldn't be usable comfortably, but whatever. I'd still like to ease my pain.
>>
>>50754026
What about
Hang on
What about actually NOT using php?
>>
>>50759095
.. And meant for >>50758500
>>
>>50759095
Oh god, how much I'd love that! Just the thought almost makes my dick rock hard. It's amazing how many nice languages there are out there that would make everything I do much nicer.

I can't, though. Job is job. I'm not the one to decide what language we use.
>>
>>50759095
why?

PHP is good though.
>>
File: externalcss.png (110 KB, 1093x1045) Image search: [Google]
externalcss.png
110 KB, 1093x1045
I'm looking for some assistance with an external style sheet I'm creating in CSS for my html pages.

It's my first time doing this, and I can't seem to get the fonts, font size, and margins to work. Are there any visible issues with my coding here? And if anybody know of a good guide lemme' know. Thanks!
>>
>>50759382
You used a colon instead of a semicolon on your H3's color
>>
>>50732210
>using the smiley with a carat nose
>>
>>50759293
I'm empathizing and god knows how little I generally care about people's comfort.

>>50759313
Most of the things I had against php aren't relevant anymore with php7, so it's definitely not bad, let's say it's decent.

Still, there are languages/frameworks for dealing with server side processing far better than php.

Hell, even node run faster than hhvm/zend engine and es2015 js is less a pain to write than php.
>>
Is it worth my time to learn React?
>>
>>50756133
Atom, brackets, geany.
>>
It took me 2 hours to solve a CSS issue.

Is web development not for me?
>>
>>50759689
It happens, don't worry. Just learn to debug and Google.
>>
>>50759689
Welcome to our world, where stupid stuff takes the most time.
>>
I'm about to start developing a website for a record label my friends and I are starting. What would /g/ use? I use ASP.net MVC at work and I like it, but I'm worried it might be a little expensive to leverage for personal use (revenue is a long way out). Azure is cool, but it's also expensive...

I like FLOSS stuff but PHP is fucking. garbage. Call me a babby if you want but I hate it. I've heard good things about django, and MVC frameworks in general provide an advantage in seo, right?

Features that are important to me are:
-Easy to optimize for SEO
-Cheap to host
-Something I can develop or maintain on my own
-Deals well with social integration, SSO via facebook/soundcloud/etc
-File hosting shit

I'm looking for any combination of advice on hosting platforms, frameworks, or other suggestions.

Thanks /g/uys!
>>
>>50759589
What is it that you consider to be "no longer relevant"? Well, at least they've converted more critical errors to exceptions, so you can treat errors the same way. When did PHP get exceptions, again? 10 years ago?

Is it the "type safety" for scalar types and the ability to specify return types? To get it, you need to add some stupid literal boilerplate at the beginning of every file that uses it, and even then it's ONLY for fucking function parameters. Want to make sure your array has numeric keys and holds a certain object types? You can't.

It's faster now, yeah. Was about time. Looks like the people who actually make the Zend Engine know what they're doing. Not that it's that much use when the people who tell them what to implement don't know what they're doing, but whatever...

The space ship operator stolen from perl? Well, this will hardly make a difference.
Meanwhile, unicode (100% irrelevant; Only English people browz da inturwebz; Why would our "web first" language support it?) is still hardly supported. the mb_ functions are a complete hack, you just never know which functions in the PHP standard library actually respect multibyte characters.The SPL is as useless as ever. Arrays are still everything EXCEPT arrays,still not objects and don't implement any Iterator Interfaces (want to use your neat, new Typehint-toy to make sure your user passes in something you can iterate over? Well, T-O-O-B-A-D-! But well, on the "bright" side, you still wouldn't be able to tell if it actually contains the type you'd expect it to, anyway.).

There is not a single function in the standard library that couldn't be implemented better. There is not a single feature in this language that actually helps with web development. When you use a framework, you use none of them. No fucking superglobals. No fucking "escape fucking everything manually". Not PHP as a templating language. no manual "header" function where you need to remember the HTTP status string by heart.
Thread replies: 255
Thread images: 17

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.