[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 | Extra juicy! | Home]

\/wdg\/

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 237
Thread images: 24

File: wdg2.jpg (209KB, 1714x900px) Image search: [iqdb] [SauceNao] [Google]
wdg2.jpg
209KB, 1714x900px
PHP is LOVE edition

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

> Tutorials & Resources
https://www.codecademy.com/ — Learn to code.
https://www.bento.io/tracks — Start here if you’re new.
http://www.theodinproject.com/ — Alternative to above, focused on Ruby on Rails back-end.
https://developer.mozilla.org/en-US/Learn/Choose,_Install_and_set_up_a_text_editor — Choosing a code editor.
https://libraries.io/ — Discover new open source libraries, modules and frameworks.
https://www.coursera.org/browse/computer-science — CompSci courses.

> Getting Hired
https://pastebin.com/4YeJAUbT/ (embed) (embed) — NEET Guide to Web Development
http://elliotec.com/how-i-got-a-job-in-web-development/

Previous thread: >>51348237
>>
Will start working on a node express SPA to control a raspberry pi and omxplayer today. We're setting two of them up so they continuously loop a video on a beamer in a local bar. The page will be available on the local network to do things like restart, pause, play, etc. Important is the automatic start on boot (one grub entry away) and shutdown/reboot functionality. Important apart from security, of course.

So far the idea is to spawn an omxplayer child process and control via stdio. Has anyone done anything like this before? Ideas? The webpage itself would be a static HTML file with some buttons and js logic to send calls to the api.
>>
I hate web development so much because I can't make sense of any of it. There's no big picture, way too many languages and technologies and none of it makes any sense.

I wish there was a book that explained the high level stuff. Learning individual languages and junk is easy.
>>
>>51381799
I of course meant rc.local, not grub.
>>
>>51381853
well, most of those technologies are complementing. you basically only need:
html > text, forms, images, multimedia
css > makes html look beautiful (use sass or less to help you write it faster)
js > make website interactive / fetch data from server
backend language (js, php, ruby, python) > serve html / json
>>
php = shit
>>
Finished my framework, put it on nuget and github, with example code for cookies in the readme and I'm hesitant to post it on /g/ because my Github is my real name.

Code here:
https://github.com/MichaelFroelich/FAP.NET/blob/master/README.md

Please be nice!

Still benchmarking mostly faster than node.js and likely most interpreted languages too, only bottlenecks seem to be parsing user defined headers for content type. That being said, its kind of expected with C#, in general it'll be faster than your ruby or python or php, except when nginx is doing something tricky with fastcgi. I wrote this for us poverty stricken guys with 5 dollars vps that still want simple code (which is why it still takes my own website ~500 milliseconds to respond), imo only way to get faster is c++ fast cgi, which for me is faster than nginx.

I'll make a YouTube video later... When I feel like it. I'd love if what I make gets popular. YouTube seems like the way to do it.

>>51382017
Why not C# for a backend language? My framework is mostly just receiving and returning strings.
>>
>>51383021
meh, sounds like a great idea, but it would take me to long to transition from my current framework (laravel) to yours.

Luckily there is hhvm for php and php 7 has some performance featueres too.
>>
>>51383155
It's fine, it'd be awesome if you used it in your next project though (especially if you used F# and wrote trippy code). Yeah I've seen php benchmark pretty good lately, which is unfortunate if I'm trying to market FAP's performance as a feature. People aren't keen to let go of php.

Otherwise a few people say it looks like a python framework but in C#, which is nice. I've seen some other C# frameworks, I feel they're ugly.
>>
php is love php is life
>>
What cookie cutter service or template is available for me to make a page with a list of all local stores that sell a certain thing? Nothing too fancy. Thinking of using boot strap and github pages.
>>
>>51383516
Google apps.

You need both location and searching.

https://developers.google.com/places/
>>
>PEOPLE USE NODE.JS, RUBY ON CUKKING RAILS OR ANYTHING BESKDES BASED PHP OR AT LEAST DJANGO/FLASK IN 2015

L M A O
>>
what is the least hipster meme framework/language? is it PHP?
I want something that just werks.
>>
>>51383730
FAP!

>>51383021
>https://github.com/MichaelFroelich/FAP.NET/blob/master/README.md
Full backend in 6 lines of code and benchmarks faster than anything this seemingly aggressive man >>51383728 suggested.

Also, the developer is a /g/entooman.

If you use monodevelop you can download it with nuget:
Install-Package FAP.dll

Or search FAP.dll, like whatever.
>>
>>51383811
I'm not an aggressive man I was just yelling.

WHEN PHP7 COMES YOU WILL ALL APOLOGIZE

Php7 blows the fuck out anything that exists
>>
>>51383811
fap?? wtf, how will you suggest it to your client?

Client: What backend sould we use??
You: FAP
Client: What did you say to me you fucking faggot?
>>
>>51383730
Django is good. It was done being hipster in the early 2000s. And Python is no meme.
>>
>>51383858
>implying a client even knows what fap means

To them it'd just be a high-tech acronym. Imagine it now, job positions saying: "Requires 10 years experience in FAP". It will be glorious.
>>
>>51383730
>what is the least hipster meme framework/language? is it PHP?

PHP is the least meme of all. Best reason why? Because it's not going anywhere.

All these meme frameworks will be gone in <5 years.
Seriously, which retard thought OF JAVASCRIPT FOR BACKEND? Someone please punch him in the head.


PHP7 IS KING
READ IT AND WEEP F A M
http://www.zend.com/en/resources/php7_infographic
http://www.zend.com/en/resources/php7_infographic
http://www.zend.com/en/resources/php7_infographic
>>
>>51383880
python feels like a meme to me
>>
How long do you estimate it takes an average learner to get from zero to hireable? Also, I won't have to go back to school will I? Kind of tired of bagging groceries and living with mommy.
>>
>>51383908
that sounds great, but I dont believe they beat hhvm.

last time I've tested it, hhvm ate them alive (altough it was against php 7 beta)
>>
>>51383894
You're getting it: never take yourself too seriously.
>>
>>51383972
Believe in based PHP.

PHP7 is the savior of all of webdevelopment
>>
>>51383942
about 2 years assuming you're not socially retarded. to get a job you can't be a generic socially awkward turbo neet nerd. You need to be a presentable adult.
>>
>>51384088
I was going to use it anyways. Django did too much abstraction for my taste, ruby sounds homo, and the other stuff is too mainstream (it will probably die)

anyways, did I do good with this commenting system (its made with react)
>>
>>51384153
In php?
>>
File: images.png (25KB, 282x522px) Image search: [iqdb] [SauceNao] [Google]
images.png
25KB, 282x522px
>>51383908
FAP.dll gets up to 4000 requests per second, about 1500 to 2000 when proxied through nginx. In some very lucky tests, I've seen it as high as 8000 requests per second.

>>51384121
>social skills are more important than git gud
Kind of like the person who actually rejected me from a job for having a programming project and asked why I wasn't a member of a football club.

Reminds me of pic related.
>>
how do I into php
>>
>>51384202
It doesn't matter how skilled you are if you can't communicate like an adult. No one has the time or patience to deal with childish nonsense.
>>
>>51384195
yes, the backend is php (laravel). But the comment system is pure javascript (react).
>real time rating, sorting, adding new comments/replies

There is also nonjs fallback, but you can only read the comments (for seo purposes). I dont want to use html forms since it will get spammed by bots over time.
>>
>>51384233
Why use Laravel over Native PHP? Laravel is just a meme-like of RoR(which is shit)
>>
>>51383908
>http://www.zend.com/en/resources/php7_infographic
>benchmark excludes Node
:^)
>>
>>51384307
>node.js
>worth including

node.js is literally a vulnerable meme piece of hipster shit. Which happens to also be taken over by SJWs.

Why you would ever use node.js is beyond me
>>
>>51384203
a) rename your html files as php
b) just go straight to laravel
there's a middle ground that's not worth treading
>>
>>51384231
You don't actually think anyone here is incapable of communicating? 9/10 it's a HR that knows this guy isn't going to become the most popular in the office and won't hire him on that basis, or she feels he's just too much like some stereotypes and is likely highly influenced by confirmation bias. It takes severe autism, as in the kind that makes you an honestly bad person for joking about, to become incapable in which case check your neurotypical privilege.

Honestly, I don't think anyone except other engineers and developers should judge engineers and developers, provided productivity rather than setting up a corporate hug box is the goal.
>>
>>51384253
because of maintainability and organisation. I'm very unorganised and if I didnt have a framework I would loose myself very fast.

Also, it handles the DB queries for me and it does it better than I would.
>>
>>51384253
Please explain how to realtime in PHP.
>>51384320
PHP is slow. Stay mad :^)
>>
>>51384332
>unironically using laravel
>>
>>51384339
>PHP is slow. Stay mad :^)

node.js is vulnerable and run by SJW hipsters stay mad :^)
>>
>>51384338
fair answer
>>
>>51384352
>PHP
>not a mess of vulnerabilities
:^)
>>
>>51384320
>mfw SJW alienate the only people who can contribute to their technologies
>mfw other companies profit on this (god only knows how many people switched from SJWFox to Chrome/Chromium based browser)
>>
>People attacking php
Guys, why can't we just get along?

And yeah, no one (except me :) ) is benchmarking against node because it completely fucks the graph scale. I noticed the same problem when trying to benchmark against interpreted languages, when things range from 40 to 4000 it's hard to plot.

People don't use php for speed though, or for security, they use it because it's popular.

>>51384320
>>51384415
It's otherwise really good technology.

I'll always do what I can to tell SJW to fuck off, critical theory is being used in a way that creates the very problems they warned against.

BTW, always remember that eggplants are racist, not sexist (and at the moment I think black men in STEM are fucking awesome, because they act antithetically to the black narrative). People should really tell feminists to stop appropriating rage, I'd do it but I'm not black.

>>51384338
Do you really need a web framework that does DB for you? That's the advantage of using JavaScript or .net/mono for a backend, there are heaps of libraries out there for databasing (or serialisation if you're a mad cunt).
>>
>>51383942
>>51384121
I would also say it depends on how much time you want to dedicate each day to learn. You'd have to have a good line of study and an end goal. Be careful looking for resources though. There is a lot of wrong, outdated, or expensive information when there is really some good free stuff
>>
What is the best way to learn PHP?
>>
>>51384525
>Do you really need a web framework that does DB for you?
yes, I've never bothered to learn SQL properly and I dont even know best practices and security measures. I could end up making SQL injection possible or fuck in some other way up.

>>51384613
you probably dont even need to learn it (maybe only the basics, syntax, classes, loops), since frameworks do the heavy lifting for you.
>>
>>51384660
Just research "sanitize sql" or use something like redis or mongodb or handle it yourself by finding a serialisation library.

Or just keep using a web framework that handles your db, you know, that's probably good too.
>>
File: 1181595555.gif (910KB, 340x240px) Image search: [iqdb] [SauceNao] [Google]
1181595555.gif
910KB, 340x240px
>>51381484
What does /wdg/ think of 4chan's source code?
http://pastebin.com/a45dp3Q1

I admire it's simplicity
>>
Anybody have any experience with jcarousellite?
The install instructions are super simple, but it isn't doing shit.
>>
>>51385244
>super simple, but it isn't doing shit
thats like what happens to 80% of what I write right now.
>>
where would you go to get some money now in /wdg/ ?
>>
>>51385405
start up an agency by yourself. contract as much work to outside foreigners. they charge like 1-20$ per hour, you get the other 100$

times that by 10 and you get 1k a day
>>
>>51385244
>>51385389
Turns out I'm just a retard who can't reference files correctly.
>>
>>51385779
>had two o fsame files
>changing one
>why the fuck isn't this working?
you can guess the rest
>>
I have an idea for a mobile app. I've never built one before but have a working knowledge of HTML/CSS/JS and want to slap together a quick mockup for Android. I found Ratchet. Is this the best framework for this kind of thing? I just want something to show a few people that's a little better than storyboards.
>>
I'm looking for a beginner-intermediate book on Javascript. Any suggestions?
>>
how do you handle responsive design without a framework?

Do you just space everything with rem?

>>51386642
Beginning Javascript by Jeremy mcpeak isn't bad. You can skip a lot of parts if you feel like you know them.
>>
Good web resource for learning nodejs + meteorite?

All I've found seem to want me to buy some crap book, I didn't have this problem when learning php there where great resources everywhere for things.
>>
Alright you fucks, I asked this yesterday but didn't get a response, so I'm trying again

I'm a retard and I can't figure out how I'm supposed to add libraries to XAMPP. I need to use the gnupg extension from PECL, but I can't install it without the GPGME library. I have that installed on my system, but PECL doesn't recognise it - I can only assume that is because XAMPP has it's own sandbox environment. How the fuck do I install a library to it? Or how do I share my OS's library with it?

Thanks in advance
>>
>>51384837
That's not the actual source ...
>>
>>51387091
well here's some general advice since I'm not familiar with XAMPP:
XAMPP's PHP should have a file called "php.ini" somewhere, in which there is a section "extensions". Find out where your GPGME extension file (.so, .dll) is located, copy it over to your PHP5 extensions/ext/lib folder (the place where other extensions are located, just a bunch of .so/.dll files), then you put another line in your php.ini file at the place I mentioned above
extension=mysqli
extension=json
...
extension=gnupg


http://php.net/manual/en/gnupg.installation.php
>>
>>51383516
>list of all local stores that sell a certain thing
overpass turbo lets you search OSM data for things like bakery, convenience store, name of the store... not sure if there's a worldwide database that's more detailled than that
>>
>>51387079
You don't need a book to learn node. Run through the official core module docs and maybe read some blog posts about V8 inline caches for best performance practices. The rest is just javascript. Also, Meteor is shit.
>>
how to create inheritance in JS using object.create?
>>
File: 1446696470225.png (2KB, 221x116px) Image search: [iqdb] [SauceNao] [Google]
1446696470225.png
2KB, 221x116px
>>51384121
what if you already know how to program C# and python as well as very little experience with markup languages, but you've never really done any real projects with them and you're a NEET with all the time in the world?
>>
>>51386642
http://eloquentjavascript.net/
>>
>>51384121
i landed a job as a turbo sperg

i quit the day after tho
>>
>>51387079
https://leveluptuts.com/tutorials/meteor-for-everyone

but meteor is junk
>>
I know I know, it's PHP, but my course makes me study PHP.

I'm really stuck here, how can I make this save the values of the $values array into the file without appending them to the end of the file? I need the existing lines to be re-written, I've tried everything.
function write($values)
{
print_r("Escribiendo al archivo los valores <br>");
print_r(count($values));
print_r($values);
$resultadosFileW = fopen("resultados.txt","wb") or die("error abiendo");
print_r(count($values));

for($i = 0;$i <= count($values);$i++)
{
fwrite($resultadosFileW,"\n\r".$values[$i]);
}

}
>>
>>51387743
Why do you find it strange posting PHP in a webdev thread?

The easiest way would be to delete the file if it exists.
For some reason "wb" is not listed in the official modes.
>>
>>51387271

Hey anon, thanks for the response. It wasn't the exact answer I was looking for but it did lead me directly to the solution - I keep forgetting that Fedora separates development libraries from the actual software, so while I did have gpgme installed, what I really needed was gpgme-devel

For what it's worth I made a note of what you told me for future reference because I'm sure it will come in handy one day

Thanks again
>>
>>51384396
The difference between a good PHP programmer and a bad one is mind boggling.

PHP is god-tier but only if you understand best practices. If you don't know what the hell you are doing PHP is ridiculously vulnerable, but if you do the right thing it's super secure.

The other languages railroad you down particular ways of doing things, which is good for beginners cause you can't go astray.

Ironically I can't think of worse advice than recommending PHP to newcomers. People say "oh in PHP you can just code it up in 5 seconds, it's easy and good place to start", but that's the opposite of what is good. You want an experienced coder to work with PHP since they are the only ones who know how to structure and secure their code properly. The flexibility available is liberating.
>>
>>51383155
(You)
>>
>>51386922
you could use sass with susy an breakpoint.
>>
>>51387793
>Why do you find it strange posting PHP
Because 80% of /g/ hates it

>is not listed in the official modes.
I append b so it doesn't crash in systems like windows where there exists a possibility there's a binary file.

> delete the file
I need a solution that assumes you may not have delete priviledge to the file
>>
>>51389206
I hate apple, but that doesn't stop the macfags from posting their threads and opinions. PHP is used in a lot of technology today. Whether or not you like facebook they make money by using PHP. 4Chan exists today because of PHP. PHP will be around for quite a while, and when it goes away, you can always change.
>>
>>51389252
Thanks for understanding, I really don't get the hate
>>
>>51387704
>>51383942
read op

http://elliotec.com/how-i-got-a-job-in-web-development/

took him a little over a year.
>>
>>51389338
PHP is a mature technology, which means that newer languages have the benefits of seeing what PHP did wrong, and have the ability to be better than PHP.

Most technology does not need to be bleeding edge because the people asking for help here probably won't be making "the next facebook/twitter/youtube" or whatever, nor are they large data firms that would benefit from the .0003 sec increase in speed per database query. PHP is very useful, especially for smaller projects and understanding how a backend works.

Also very useful for the include/require statements alone.
>>
Fuck you guys I'm going to use Angular. The docs suck but it gets the job done. Your fucking meme frameworks wasted my entire weekend.
>>
>>51389785
>needing frameworks
>>
>>51389976
Yeah, if you are actually doing work and getting paid
>>
>>51387743
Still trying to figure out a solution here, I've pinpointed it down to this function
>>
>>51389785
i like using react more, but if you are making a SPA you could as well use angular.
>>
>>51383942
A degree won't help you anymore so you should save money and time by skipping your revisit to school.
>>
I have question about databases: in relational databases you can establish a relation between different tables. However in non-relational databases you too can establish pseudorelation by insert text/integer whatever datatype you want to relate in other table. So why use relational databases when non-relational databases are often simpler to use?
>>
>>51381484

any angularJS developers on?
>>
File: 1446942573050.jpg (718KB, 744x1049px) Image search: [iqdb] [SauceNao] [Google]
1446942573050.jpg
718KB, 744x1049px
I need a video player with playlists for a website, and MAYBE live streaming, but probably not, what should I do? I want to personalize it that's why embedding a YT playlist won't work.

I heard Flowplayer is good. Is it true?
>>
>>51390635
i like using it for stuff like this (pic related). I dont have to give a fuck about the "post_ratings" table in this example.

If I delete a post, it will delete all post_ratings in with the post id automatically

other than that, i dont know good usecases..
>>
What is /g/'s opinion on the Phoenix framework?
>>
File: resume_comic.png (122KB, 1000x1853px) Image search: [iqdb] [SauceNao] [Google]
resume_comic.png
122KB, 1000x1853px
>>51384202

Fullsize image if anyone wanted it
>>
my recruiter is constantly trying to get me to learn angularJS, apparently he thinks there is a lot of demand for it. I kind of hate JS
>>
>>51391116
Well most of the web uses JS.
>>
>>51390795
>>51390635
How well do NoSQL databases perform in JOIN benchmarks?
>>
who /BuzzFeed/ here?

<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css" />
<title>My Photo Page</title>
</head>
<body>
<table>
<thead>
<th colspan = 3>My first table of Rare Pepes</th>
</thead>
<tbody>
<tr>
<td><img src = "http://i.imgur.com/D7rMzsQ.gif" /></td>
<td><img src = "http://i.imgur.com/n8McQ1Al.jpg" /></td>
<td><img src = "http://i.imgur.com/gUKzeUtl.png" /></td>
</tr>
<tr>
<td><img src = "http://i.imgur.com/pUAG96al.jpg" /></td>
<td><img src = "http://i.imgur.com/HAHvjzMl.png" /></td>
<td><img src = "http://i.imgur.com/i50AZzgl.png" /></td>
</tr>
<tr>
<td><img src = "http://i.imgur.com/4EApFijl.jpg" /></td>
<td><img src = "http://i.imgur.com/Jk8ZzkMl.jpg" /></td>
<td><img src = "http://i.imgur.com/XHykLww.gif" /></td>
</tr>
</tbody>
<table>
</body>
</html>
>>
>>51388095
No problem. On Linux a lot of times PHP extensions are installed via command line, for example on ubuntu with
apt-get install php5-json
, etc. Glad you solved it
>>
How would I go about implementing a BaaS in C#.NET? For school we have to make a pretty intense big data analysis tool -- on the condition that it's written in 95%+ C#...
It basically consists of three parts:
- The database and access to it
- The (RESTful?) API or similar, but seeing as all the clients are .NET as well, might TCP be better?
- The web bots, collecting data from all kinds of API's and storing them in the database

I have a pretty good idea of how I would make it if it were in Python or >Node, but C# would definitely NOT be my goto language for this kind of thing.

Anyone got any tips or good libraries that are useful for this? We're looking at an ORM for the database at least, and I guess ASP.NET would do for the RESTful API (unless we use TCP). I just don't know how you would go about running a separate "information-collection" process next to those.
>>
>>51391350
good table
>>
File: 1446109958599.gif (4MB, 220x327px) Image search: [iqdb] [SauceNao] [Google]
1446109958599.gif
4MB, 220x327px
>>51392667
>>
>>51391116
JS is an easy way to outsource processing to the client.
>>
What's a good place to learn PHP and MySQL?
>>
>>51383928
Python 3 is a meme. Python 2 isn't
>>
>>51394836
in a dumpster
>>
Starting to learn webdev here.

I know HTML, and I just got the hang of CSS with floating and shit like that, but I'm not very experienced in it yet.

I don't know what I should practice or how I should practice it though. I have absolutely 0 ideas on what to do.

Also, I've been using freecodecamp to help push me along. Has anyone else used them? They seem to be all over the place. They want me to learn Jquery before Javascript, and even then, they literally just throw tutorials at you without fully explaining what it does.

The first Jquery Tutorial (mind you, this is before javascript ) has you make buttons bounce and shake. With no explanation other than "it makes the websites interactive."
>>
>>51395525
+1337 edgy points
>>
>>51394836
You can start on youtube or any place you want.
After a year, please check this link:
http://phptherightway.com
>>
Is there any specific stack that would be better to learn over another?
>>
File: Mqra3Sn.webm (2MB, 720x404px) Image search: [iqdb] [SauceNao] [Google]
Mqra3Sn.webm
2MB, 720x404px
fk php
>>
>>51397146
>NOT using php
what's it like being a meme
>>
File: 1446554314935.jpg (25KB, 500x376px) Image search: [iqdb] [SauceNao] [Google]
1446554314935.jpg
25KB, 500x376px
>>51397162
$100k salary starting
>>
Is there a smaller alternative to Angular? The minified+gzipped version is larger than my entire js+php codebase, this makes me uneasy.
For now I'm going to replace jQuery with Zepto which is much smaller and mobile friendly.
>>
>>51397466
how much is it?? if its less than 100k I wouldnt bother
>>
I want to loop through names for a text field in php, how would I go about doing this?

for example I have an array for car names
$car_brand = array("Volvo","BMW","Toyota");


but I want them as the names for each field as I loop through it
<input type="text" name="[INSERT ARRAY HERE]" size="2" maxlength="2">

Hope that makes sense
Any ideas? I have both done seperately
>>
>>51398498
Let me elaborate more, so that it'll show as
<input type="text" name="Volvo" size="2" maxlength="2">
<input type="text" name="BMW" size="2" maxlength="2">
<input type="text" name="Toyota" size="2" maxlength="2">
>>
Why does my modals reappear for a split second immediately after i close them and then disappear? Its like a quick flash whenever i close them. They go away, come back, then go away again.


What can cause this???
>>
>>51398745
I just noticed something when inspecting the modal. When i close it, the display goes from block -> none -> block -> none. Its doing it twice when it should only do it once. Whats causing this black magic???
>>
>>51398890
Maybe you are triggering the click event twice.
>>
>>51398498
php.net/manual/en/control-structures.foreach.php
>>
>>51398908
Yes obviously, but why? Seems like such a strange bug. I havent even touched JS or modals before this, its just doing this out of the box.
>>
>>51398990
Perhaps you are attaching the dialog twice, or there are 2 modal scripts in the html.
>>
>>51399030
Nope, even if i have a fresh and empty page with only 1 single modal it still does it, even if i use copy-paste example from w3schools :(
>>
Do any of you know what the dollar sign does in the meteor framework?

I'm trying to learn it and I have no idea what $or or $ne in this code snippet does

if (Meteor.isServer) {
// This code only runs on the server
Meteor.publish("tasks", function() {
return Tasks.find({
$or: [
{ private: {$ne: true} },
{ owner: this.userId }
]
});
});
}
>>
>>51399155
nvm it's mongodb stuff

https://docs.mongodb.org/manual/reference/operator/query/or/

https://docs.mongodb.org/manual/reference/operator/query/ne/#op._S_ne
>>
Help me come up with ideas on how I can make money with a fuck load of AWS credit
>>
>>51387707
Not the referenced anon, but I'm going through this material too.
Haha. I thought JavaScript would be simple.
>>
add this to the Sticky?
>>
>>51401170
http://www.openculture.com/freeonlinecourses#Computer%20Science%20Courses
>>
Really though, PHP in 2015?
>>
File: 1394680868006.jpg (22KB, 310x309px) Image search: [iqdb] [SauceNao] [Google]
1394680868006.jpg
22KB, 310x309px
>>51386922
>>51387707

thanks lads

>>51400797
wat
>>
daily reminder that webdevs are not real programmers

Have a nice day.
>>
>>51402640
Daily reminder FizzBuzz is not programming. Have a nice day.
>>
>>51402640
why?
>>
>>51384153
Django doesn't force you to abstract shit. Just return HttpResponses from your views you trogdolyte
>>
>>51383728
And why exactly is Python/Django "better" than Ruby on Rails?

inb4 sjw-hipster community used to justify technology decisions
>>
>>51389338
A bit of a meme.
>>
>>51401179
http://www.openculture.com/freeonlinecourses#ComputerScience
>>
>>51401846
wat indeed, my fellow anon. wat indeed.>>51400797
>>
>>51402928
I like django better because of the loose coupling
>>
>>51384837
Poor Moot. I wonder why he didn't rewrite it in a decent language.
>>
I'm building a timer in javascript. It has two timers inside it - the first counts down from your input (say, 25 mins) and when it reaches zero, it starts the other timer, which counts from its setting (say, 5 mins) down to zero. When the second timer reaches zero, it restores the original values for both timers, and starts the first clock counting down once more.

I'm doing this using setInterval. I have a button that functions as a start/stop. When you press stop, it calls clearInterval on both timers to stop them. This works fine when you call the stop on each timer during their first cycle, but if you call it after the second clock initiates the first clock's second loop, it won't work.

I assume this is some problem with the setInterval IDs associated with each setInterval.

I've written some pseudocode below to help illustrate:
function timeCaller(){
var first = setInterval{
// lots of code
var second = setInterval {
//lots of code
timeCaller();
}

button.click(function(){
clearInterval(first);
clearInterval(second);
}


Any help would be greatly appreciated. Not sure what to do about this - but an ID problem seems to be the most likely cause.
>>
>>51383021
I'm curious as to why you insisted on re-writing most of the basic HTTP infrastructure when Microsoft have already provided a well tested, lightweight component (HttpServer), which could have easily been adapted to meet the functional paradigm.

Here are a few of the problems with your framework as it stands:
>Lack of support for HTTPS
>Lack of unit tests (at least not on the git repository)
>Poor code quality/readability (one method spans over 200 lines/magic constants)
>Lack of extensibility points (e.g ability to inject middle-ware into the pipeline)
>>
>>51405411
Because I could, first and foremost. I needed a project to continue my self education.

Because I felt functional programming ideas was a good idea for a web framework, revolving around the get, put, etc and yes, I know it turned out way more oo

Because most microsoft of frameworks I tested were abysmally slow and I really wanted something that could tolerate "cloud computing", ie buying a VPS that gives you the computing power equivalent of an Pentium 3. There are other light weight frameworks and libraries, but I feel they're ugly from the users perspective, whereas mine is only ugly when you're digging through my github.

>>Lack of support for HTTPS
An honest critique. I thought about it recently, how would I most effectively detect SSL and efficiently process it? Besides, I'm also not going to implement gzip (another thing I contemplated), because ideally you should be using a proxy in between like nginx or apache.

>>Lack of unit tests (at least not on the git repository)
If I wasn't using C# (or Java)..

I had a static main function to test and benchmark it early on, but then I started writing for my own website to test it.

>>Poor code quality/readability (one method spans over 200 lines/magic constants)
There are very few magic numbers, we both know I created an entire static class to mitigate magic constants. The two (yes, were talking about two other magic constants) I just couldn't be fucked sticking at the top of the file.

Poor code quality could be your dunning-kruger effect,
don't you think? I've optimised it to get every nanosecond I could, not so much to win elegant code competitions. I know full well large parts of it are ugly, especially the ternary operations.

I should probably use string format, something I'm honestly going to get around to eventually

>>Lack of extensibility points (e.g ability to inject middle-ware into the pipeline)
To be honest I have no idea what you mean by this.

Otherwise, thanks a lot for your feedback.
>>
$a = true;
if (isset($a)) {}

Is this the fastest and most efficient check one can perform in PHP, or is there something even better?
>>
>>51405923
If you are sure the variable already exists, and has a non-empty value, use this:
if($a){}

>>51405288
I don't think that's 4chin source code. I believe a python developer was working on it.
>>
>>51405392
Never mind dudes, I solved it - the problem was unrelated to setInterval in case anyone gives a shit
>>
>>51385518
How can i get clients? Freelancer is very competitive.
>>
File: dva.jpg (200KB, 894x894px) Image search: [iqdb] [SauceNao] [Google]
dva.jpg
200KB, 894x894px
/WDG/!
rails or laravel?
>>
>>51395562
>I don't know what I should practice or how I should practice it though. I have absolutely 0 ideas on what to do.

Start with basic websites, play around with them. Create your portfolio site, rent a server and host it. Get the hang of getting something running.

>They want me to learn Jquery before Javascript
DONT. JQuery is literally simplified (yet powerful) JS. You need to know JS.
>>
>>51401212
Why not, ur mum lasted this long.
>>
>>51406192
Rails, it'll help you get laid ;)
>>
>>51406272
I have a boyfriend already senpai
>>
Hey you fucks. Is getting into webdev worth it at this point? Or should I just learn regular programming.
>>
Why would anyone even want to learn all of these convoluted languages when you could just use Wordpress?
>>
>>51407531
To customize wordpress of course.
>>
Since when did webdev become so fucking full of bullshit?
gulp,grunt,bower,jspm,yeoman,npm,composer,babel,typescript
I just want to open the editor and type shit I don't give a fuck about your meme tools.
>>
>>51407117
Depends entirely on what type of person you are. If you prefer fancy visuals and flashy lights, sure, go for web dev. Real programming is a lot more advanced and, in my opinion, rewarding.
>>
>>51407807
Then do that. You'll just either be working with PHP or be far less productive.
>>
>>51407807
It's always been shit. Everybody is a teenager.
>tfw the devs of every fucking library you have to use are focused on delivering the next greatest non backwards compatible version ever and they don't give a fuck if the company you work for has invested piles of money in training, support and infraestructure for those technologies
Good thing I'm not the boss.
>>
File: 1447674413187.jpg (141KB, 800x916px) Image search: [iqdb] [SauceNao] [Google]
1447674413187.jpg
141KB, 800x916px
>2015
>input[date] still not supported on firefox
>>
>>51407881
but there just aren't as many jobs in 'real programming' as there are in web dev
not at entry level anyway
>>
File: 1408623397110.png (30KB, 300x80px) Image search: [iqdb] [SauceNao] [Google]
1408623397110.png
30KB, 300x80px
Hey /wdg/

How much of frontend does a backend developer needs to know?

I am learning backend and i know basics of html and css decent but not js. There is too many frameworks and shit idk what do I actually need to learn

thanks for replies
>>
>>51408550
well, i got hired for backend, on the second day they wanted me to make a js slider

you kinda have to know how to do do everything on both ends. the difference is, as a backend dev, they won't ask you for original designs or something like that
>>
>>51406196

I already have ran and managed several websites, and I currently have one >fansite up and running. I'd like to optimize it and upgrade it, but I just don't know what the fuck I should do with it.
>>
>>51408821
well fuck
is it hard?
>>
>>51409423
A lot of girls are frontend devs, that should tell you enough.
>>
>>51409423
no, but it is boring as fuck
>>
>>51409423
just use bootstrap and the slider which comes with it.

but no, its not hard to make sliders once you know js/jquery well enough. you probably would have to know about css transitions too
>>
> be senior software dev
> open /g/ after not being here for months
> see this thread
> post this
> CTRL-W
>>
>>51409546
>CTRL + W, not COMMAND + W

nothing of value was lost
>>
>>51409603
hahaha you sure showed him, fellow macfriend :D
>>
Javascript:

gamePieces[selectedTeam][i] = new Piece(selectedType, selectedTeam, MAX_CIRCLE, startR + i, true);


This creates my game pieces and stores them in an possibly temporary array. I also have a Piece.prototype.addImage(source) that takes the source of an image, and adds the Piece object.

How janky would it be for my source to be
source = "img/pieces/"+selectedType+selectedTeam

gamePieces[selectedTeam][i].addImage(source);



Also, I'm new and trying to learn, and I know my JS is a shitty mess. I started reorganizing last night, ended up going to sleep, and now I don't have a clue where I left off.

Also, some of this shit is temporary to get the logic working. I'm going to go in later to fix scaling and the like.

Tips very much appreciated.

http://pastebin.com/xeVQ93wv
>>
>>51409640
well, he is kind of right though.. webdev is getting boring.

I used to watch to get up with trends..
https://teamtreehouse.com/library/the-treehouse-show

..but even they gave up, since they kept on repeating the same shit.
>>
>>51409769
What a mess, you need to organize that shit into proper objects.
>>
Is getting into webdev even worth it at this point or should I just learn python?
>>
>>51409870
>What a mess
Exactly why I'm posting it here
>>
>>51409886
Why not both? Django or Flask is nice to work with.
>>
>>51409870
Also, what shit are you talking about exactly?
Shit is too broad of a word when referring to anything I make
>>
how would one structure comment and comment replies in databases?

should I make to separate tables, or should I put them all into one table with a "parent_id" column?
>>
>>51409962

Please respond.
>>
>>51381853
lol what? there are three things you need to learn, HTML, JS and CSS. Thats it bud. Don't get suckered into the hipster shit, none of it will be around for long.
>>
>>51409996
Everything, use classes and keep the global namespace clean.

>>51410008
Something like MPTT would be very database and performance efficient

Other than that you should keep references to the content the comment belongs to and if it's a reply you'll want the ID of the parent comment as well.
>>
>>51410119
well, i'll only allow one level of replies (cant do replies on replies).

but then I would have to format the data from php arrays to json.

should I do two loops? first loop gets the first level of comments and saves them to array. second loop adds the replies to each first level comment.

or is there any better way?
>>
>>51410034
well, shouldnt your function return something. I'm no python expert, but doesnt pass just move on and doesnt return anything??
>>
>>51410034
>>51410278
Sounds more like he's running it through file:// or something.
>>
Is it possible to solely be a front end developer or do I need to know both back and front end?
>>
>>51410574
you could use wordpress and learn minimal php needed to modify wordpress templates.

also, wordpress does have great documentation with examples too.
>>
I posted in wrong thread before, maybe here somebody will be able to help me

Any PHP dev around here?

I have problem using PHPUnit.

Lets say I have 2 classes
Class A
Class B


Class B use methods from Class A.
To test those classes I have in separate folder
Class TestA{
require_once Class A
}

Class TestB{
require_once Class B
require_once Class A
}



But when I run test it crash at Class TestB
PHP Fatal error: Cannot redeclare class Class A in Class TestB



I tried, require_once, require, include. I tried to require_once only one time, in the file where this class is tested.

It does not work.

Is there any solution for this error?
>>
>>51410868
http://stackoverflow.com/questions/708140/php-fatal-error-cannot-redeclare-class

is it true that millenials cant into google'??
>>
Well boys. I'm taking the dive. Starting bento.io course now. Wish me luck
>>
>>51409423
Making a slider from scratch is not that easy. Well, at least not for someone who has under one year experience with JS.

You need to come up with a way to store the current state of the slider and just keep making sure the slider (container/stage) can run the transitions in each state.

The concept is actually a bit retarded and everyone is basically doing it the same way, by translating divs/lis/etc inside a huge container.
>>
hey I was wondering if you guys could help me with a java script problem I'm having. I'm going through the code academy java script lessons and am also saving the lessons so i have a reference to look back on, but when i move this over to my computer it wont print out the object from the search function. instead it prints out [object object] can anyone take a look at it.

<html>
<body>
<script>
var friends = {};
friends.bill = {
firstName: "Bill",
lastName: "gates",
number: "192-168-001",
address: ['One Microsoft Way','Redmond','WA','98052']
};
friends.Steve = {
firstName: "Steve",
lastName: "jobs",
number: "192-168-002",
address: ['two apple Way','Redmond','WA','98052']
};
friends.jacob = {
firstName: "Jacob",
lastName: "gaybags",
number: "192-168-003",
address: ['three gays Way','Redmond','WA','98052']
};


var list = function(friends){
for(people in friends){
document.write(people);
}
};

var search = function(name){
for(var people in friends){
if(friends[people].firstName === name){
document.write(friends[people]);
return friends[people];
}
}
};
list(friends);
search("Bill");
</script>
</body>
</html>
>>
>>51411379
You're printing the object, you need to loop the variables if you want to print those or use JSON.stringify
>>
>>51409546
isn't backend web dev on same level with that of regular software development?
>>
>>51411379
well it works well. you are printing an object
>>
>>51411422
>>51411503
I'm confused in the CA lessons they use console.log() but this wont print the the HTML file is it a limitation of document.write() and i need to use a different method to print?
>>
>>51411582
oh well, now I understand what you are asking. You cant print an object to the document window. But you can print its proprerty (like firstName)
>>
>>51411643
ah gotcha so if i wanted to print all the elements in the object i would first need to know all the elements in the object and the loop through them? >>51411422 that cleared this anons post
>>
>>51407531
You're gonna have to learn PHP if you want to build something other than a pretty theme on top of WordPress.
>>
>>51411666
or you could use JSON.stringify(friends[people]))

but anyways, you should just use console.log for such things, it makes no sense to print a stringified object (except if you want to send it to a server for processing or saving it in a DB)
>>
I'll probably ask something that shouldn't be asked at all, but why are people SO against Dreamweaver/Muse? I mean, if all you want is to build 1-2 page site in very short amount of time, why not?
>>
anybody switched to DICSS??
https://github.com/letsgetrandy/DICSS

I've got tired of Sass and Less honestly, why not try something new?
>>
>>51411734
desu I was just doing it so I could open it up and just see what my code was doing but I guess going into my debugger is much easier.
>>
Anyone ever done web-dev in really esoteric languages before, like Haskell or Lua?
>>
>>51411666
You can loop objects like this:
var person = {
firstname: "John",
lastname: "Smith",
age: 50
};

for(var key in person) {
if(!person.hasOwnProperty(key)) continue;
alert("Key: " + key + " - Value:" + person[key]);
}



The "hasOwnProperty" is so you don't get inherited stuff and only the values themselves. But like anon said above, console.log for debugging is the best way.
>>
>>51411038
I would not ask on 4chin before looking on internet.
As I said in my post none of those solution works.
>>
File: prowebdev.png (10KB, 318x359px) Image search: [iqdb] [SauceNao] [Google]
prowebdev.png
10KB, 318x359px
Is this what pro frontend dev looks like?
>>
>>51412223
Why do something that's already been done?
>>
>>51412054
 if(!person.hasOwnProperty(key)) continue;


will skip the alert if the value is === false and then move on to the next element in the object. so in the object below this would skip over isGay.

   
var friends = {
isGay:no
};
friends.bill = {
firstName: "Bill",
lastName: "gates",
number: "192-168-001",
address: ['One Microsoft Way','Redmond','WA','98052']
};
[/code ]
>>
>>51412223
Most if not all of its going to be read from your browser's cache on subsequent page loads. Its a moot issue in 2015.
>>
>>51412315
Yes and it totally is not parsed or loaded into memory.
>>
>>51412251
not this guy, but you could probably get away with less javascript.

he should have merged some of those files for less request.

>>51411953
bump for interest
>>
>>51412260
it looks weird to me but it works well thanks guys.

<html>
<body>
<script>
var friends = {};
friends.bill = {
firstName: "Bill",
lastName: "gates",
number: "192-168-001",
address: ['One Microsoft Way','Redmond','WA','98052']
};
friends.Steve = {
firstName: "Steve",
lastName: "jobs",
number: "192-168-002",
address: ['two apple Way','Redmond','WA','98052']
};
friends.jacob = {
firstName: "Jacob",
lastName: "gaybags",
number: "192-168-003",
address: ['three gays Way','Redmond','WA','98052']
};


var list = function(friends){
for(var people in friends){
console.log(people + " ");
}
};

var search = function(name){
for(var people in friends){
if(friends[people].firstName === name){
for(var key in friends[people]){
if(!friends[people].hasOwnProperty(key))continue;
alert("key: " + key + " - Value:" + friends[people][key])
}
}
}
};

list(friends);
search("Bill");
</script>
</body>
</html>
>>
File: spittake.gif (2MB, 400x225px) Image search: [iqdb] [SauceNao] [Google]
spittake.gif
2MB, 400x225px
>Add Cloudflare to my site
>Suddenly I have HTTPS and my response times are about a third of what they were before

Uh.

There's a catch to this, right?
>>
>>51412543
There's a cache to that, yes.
>>
File: Grainger.jpg (1MB, 1600x2000px) Image search: [iqdb] [SauceNao] [Google]
Grainger.jpg
1MB, 1600x2000px
>>51412558
I fucking knew somebody was going to make that pun.
>>
>>51412154
Can you use Composer and autoloading instead of require/include?
>>
>>51412543
The catch is now there's an SSL-breaking third party in the middle of all your communications, so if the government serves Cloudflare a warrant you're owned silently.
>>
>>51412903
https://letsencrypt.org/ soon™
>>
>>51412903
So I'm sacrificing some freedom to gain some cash.

...In my current situation this is kind of worth it.
>>
>>51412223
Yes

>>51411911
It was designed with designers in mind. The idea was to allow them to drag and drop things that they style onto a web page, but in the process you completely lose control over your code. It becomes unworkable for even minor edits.
see: http://www.webdesigndev.com/10-good-and-10-bad-things-about-adobes-dreamweaver/


That was back in like 2010 when that was written. Today, it's probably much like any other IDE, but aimed toward designers. But really, designers don't want to code or even touch an IDE. They just want to smoke pot and draw pictures in photoshop and leave it to the devs to create. There's really nothing that dream weaver can offer a developer that isn't already out there
>>
what do u guys think abour adobe muse?
>>
The guy I replaced left a HUGE mess in our project. My coworkers aren't ones to bad mouth anyone, but the words, "Spaghetti code" were dropped Monday. Two questions:

1. What do you do with spaghetti code? Toss it and remake, roll with it?

2. I'm new on the team, the rest of the team is just now seeing how bad this code is. I started on the project last Monday. For all they know, much of this could be my code. How do I avoid getting lumped in with his bad code?
>>
>>51413950

Failed to refind the video which describes the process, but you could try incremental migration to react.js. I.e., you replace one thing at a time starting with something easy like dynamic footer content. The site can be half the old framework, and half react.js and still work.
>>
>>51414337
how does one SEO with react?? Everythin I do with react renders after the site loads, can search engines see this?
>>
PHP is literally the hipster web language now since it isn't "cool" anymore, making it the underdog to everyone but Pajeets, meaning 4chan autists back it since they're so edgy. Seriously if you are learning PHP instead of any other language you are doing yourself a serious disservice.
>>
>>51381484
>https://pastebin.com/4YeJAUbT/ (embed) (embed) — NEET Guide to Web Development

what does helping neets have to do with web development
>>
>>51413950
are you not using git?
>>
>>51414817
TFS, but yes version control
>>
>>51414845
then you should be able to see the history of each line of code, right?
>>
>>51414864
yes, but his code makes up massive functionality rn. cant just yank it all out and replace in one day
>>
>>51414887
well i was talking about question 2 in your post anyway
>>
>>51414906
oh, nobody has the time to look through that
>>
>>51414910
then i don't see how they could blame you for his code
>>
>>51412543
See: >>51412558 (a very underrated post)
If you're like me and want every click to contact the server, cloudfare isn't what you want.

Also, guise don't say nigger on my website, I'm trying to get a job! (but thanks for commenting and making it look like people are visiting)

>>51414614
C# has made my backend code neater than my frontend code... Just ignore all the work I did on my personal web framework and how ugly that code is.
>>
>>51390018
>not making your own framework
Thread posts: 237
Thread images: 24


[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]
Please support this website by donating Bitcoins to 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
If a post contains copyrighted or illegal content, please click on that post's [Report] button and fill out a post removal request
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 4Archive shows an archive of their content. If you need information for a Poster - contact them.