[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
OLD THREAD >>54221822 > Discord https://discord.gg/
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: 11
File: 1461602465135.png (862 KB, 822x552) Image search: [Google]
1461602465135.png
862 KB, 822x552
OLD THREAD >>54221822
> Discord
https://discord.gg/0qLTzz5potDFXfdT

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

>Learning material
https://www.codecademy.com/
https://www.bento.io/
https://programming-motherfucker.com/
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md
https://www.theodinproject.com/
http://www.freecodecamp.com/
http://www.codewars.com/
>Crockford on Javascript
https://www.youtube.com/playlist?list=PL7664379246A246CB

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

>Backend development
https://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks

>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.
https://developer.mozilla.org/en-US/docs/Web - Guides for HTML, CSS, JS, Web APIs & more.
http://www.programmableweb.com/ - List of public APIs

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

> How to get started
http://www.youtube.com/watch?v=pB0WvcxTbCA [Embed]
Good videos on the channel too
https://www.youtube.com/channel/UCVTlvUkGslCV_h-nSAId8Sw

>cheap vps hosting in most western locations
https://lowendbox.com
https://www.digitalocean.com/
https://www.linode.com/
https://www.heroku.com/
https://www.leaseweb.com
>>
How do I know if I'm ready for a job?

I feel inadequate and am constantly learning despite having been studying for years.

I made a shitty test based CMS with php. Looks cute, but I still feel like a retard when I speak with others who know so much more about a niche language or architecture.
>>
>>54247163
How good are you at PHP? Since you've already worked with it, why not try to master it? Become so good at it that you can code or develop just about anything in that language using a plethora of techniques that maximize efficiency and quality. It's a pretty good way to know you're ready when you can master something.
>>
all my tests passed

by i missed a use case
>>
>new boss got me a present
>wants to promote me
>I want to quit and get a web dev job

It's times like this I question life.

[/blog]
>>
>>54247285
But everyone makes fun of PHP. I feel like mastering that would be a waste...
>>
>>54247323
>this guy actually cares about the opinions of /g/ posters
Ha, how novel. There are tons of jobs out there for PHP developers. While PHP may be losing popularity, it is in no way a rapid decline and will continue to be relevant for a long while. Mastering it will put you in a great position to become employed in a top position. I saw a job listing the other day for a PHP dev and the salary was around $120k/yr (granted, they wanted other stuff with it too - but mostly front end shit like Angular2 + knowledge of PHP frameworks).
>>
>>54247316
I think he wants the D. Take the D but do web dev shit on the side like a real man.
>>
>>54247391
How do I know if I've mastered it?

I'm always going back to documentation or googling for stackoverflow answers
>>
Can someone explain the difference between models and controllers in MVC? I can't grasp it
>>
For the guys who use Node, what's your setup?
Right now my setup is as basic as it gets. I'm running commands everything I need to refresh the server, for example. What tools do you guys use for Node to make thing a lot more comfy?
>>
>promise sister free website
>haven't started
>promised it like 4 months ago

I'm so bad at design, guys. I don't want to make something shit but I don't want to make nothing. It's also time taken away from my personal projects. It's not like I'm not saving her 4 grand though.
>>
>>54247706
Models basically deal with the database shit
Views manages what gets presented to the user (hence the name view) and shit
Controller oversees/handles the transfer of shit from the Model to the View

The controller 'controls', the model creates the structure of the data.
>>
Who /jack of all trades yet master of none/ here?
>>
>>54247976
o/ meeee
I've dabbled in every language and every major framework for web dev (except .NET/C#) so far. I even know a little about android development.
I'm most comfy with PHP though. Would like to take a minute to stroke my own ego and say I'm pretty damn good with it.
>>
>>54247976
I do fullstack. I'd rather focus on the backend.
>>
>>54247976
Literally me. Not enough to get a job, enough to talk about everything.

I'll be honest, I probably like learning about this stuff more than actually programming these days.

Of course give me an adderall and I can do the work of 10 men at one time. That shit should be OTC.
>>
>>54247122
>Use C#, Use MVC at work - wanna try the new one
>docs are shit, SignalR on MVC is broke

>Need websockets
>mfw only option is Node.js + Socket
I've used node before, but i far more prefer C# and MVCs code style

-

Also - the new project i'm working on is kinda small - Gonna be hybrid: Server Side and Client Side Rendering (New elements retrieved from websocket will be appended to the server)

Just need: DOM Manipulation and *Maybe* HTTP get.
I'm used to using more features so selecting a JQuery or Angular was a no brainer. but am i better off writing it in vanilla JS or should i be looking at just getting a library\framework

If i should, what should i go with - it just needs to be mobile friendly - Time and logistics prohibit native apps from happening. I'm only familiar with Jquery and Angular, I know of react and backbone.
>>
I've seen some great ideas that never took off.

I wonder why.

Seriously, some amazing ideas that are just perfect for this current world of social greed, yet they didn't move at all.

I would ask why, but I think it doesn't even matter as "why" is completely subjective and obviously entirely wrong. A good service should advertise itself.
>>
I have an interview for an node.js position, what questions should I be expecting?
>>
>>54248905
Questions about node.js
>>
>>54247323
PHP gets an unfair bad reputation.

Since PHP5 and 7 came out, a lot of issues have been fixed.

Not to mention that PHP is very fast now, beating pyrhon 3 and ruby on rails in performance tests.

Getting work is easy as very many sites use it.

If you like the style and syntax of PHP best you should continue with it.
>>
what's a typical university "web programming" course like?

I'm taking one in the fall, it's a 400 level course and the only thing I know about it is that we are using "Learning PHP, MySQL, and JavsScript with JQuery, CSS, and HTML5" by Robin Nixon.

http://www.amazon.com/Learning-PHP-MySQL-JavaScript-Javascript/dp/1491918667
>>
>>54250308
Is it possible to do these courses for a degree without having to do History or English and writing classes?

That shit should be banned and everyone knows it. No programmer needs to know what was written on the tree after the roanoke colony disappeared.
>>
Wow, wdg is really dead these days.
>>
>>54248629
You can use nginx+ruby+faye/websocket
>>
>>54250308
Be prepared to make a shitty generic storefront with shopping cart

If it is anything like mine you won't learn much.
>>
A site like 4chan hosts images without having the rights to it. The website I'm working on will also likely have copyrighted images. On request I'll take them down though. But I dont want to lose my domain name because of it.

So I was wondering what a good registrar is that will ignore dmca notices. So I can handle them myself without a registrar breathing down my neck.

Any suggestions?
>>
>>54252801
considering that going into it, I know jack shit about web development, I might learn a good bit. Seriously tho, senior software engineering student and I barely even know what javascript is, let alone the other stuff. It's embarrassing.
>>
>>54252974
To add. The site is bit like tripadvisor. But users will be able to upload shit. So I need to mitigate any risks.
>>
>>54248714
> I made some shitty social media app and it didn't take off boo hoo
>>
I want to kill myself lads.
>>
>>54254099
join the club
>>
>>54254099
>>54254162
You guys should start a fight club or something
>>
number of posts worth reading ITT: 0
>>
>>54254414
number of posts worth reading ITT: -2
>>
>>54254600
That's not how that works idiot. It would still be 0.
>>
>>54254414
well, so give me some exercises to improve my js/jquery skill

got bored an made this yesterday https://jsfiddle.net/faires123/upxts4ky/
>>
>>54247777
>4 grand
just set up a wordpress site and install a theme she might like
literally 1 h of work
>>
>>54254694
why? I am here to find valid info too, sadly didnt see anything worthwhile so far.
>>
>>54254751
>here to find valid info
>doesn't ask any questions

Ok then.We're all psychic anyways so no need to ask anything.
>>
I can't get the newer versions of Ruby on Linux for some reason. I can only get 1.9.1, does anyone know why?
Pretty new to development on Linux btw. I just made the switch from Windows.
>>
>>54255787
what distro?
>>
>>54255787
don't use ruby; it's a shit
>>
>>54255787
https://github.com/rbenv/rbenv

Take a look through the github for rbenv. Allows you to test multiple versions of ruby.
>>
>>54250270
Python 3 is slower than python 2 in most benchmarks. How does php compare to py2?
>>
>>54254700
Pretty much this

If you arent getting paid for something, dont pour in 50 hours a week.
Sit down, do it over 4 straight hours

>put wordpress site up
>find and install theme
>install plugins, wordfence, seo, cache
>fix settings and layout a bit, trim the rough edges
>done, she can now post and shit.

If she wants more then let her pay you a little.
As a programmer, it is easy to take on too many free projects as favors.

Or do updates when you have time.

Do it incrementally
>>
>>54255815
Mint.

>>54256053
Thanks.
>>
What is the term used to describe creating a new page instead of 404ing? Like in wikipedia for example where if you type in https://en.wikipedia.org/wiki/fjdsfdsafd, it'll create that page for you.
>>
>>54256737
I'm not sure what the term for that is, but wikipedia is just searching a db for a page called /wiki/:whatever and plopping the resulting data into a template. If it can't find :whatever puts it in that template instead and serves it up as a custom 404 page. If you check the status code for the page, it's still 404.

https://en.wikipedia.org/wiki/fjdsfdsafd doesn't continue to exist as a page after you put it in, except maybe in a log or cache somewhere.
>>
>>54256969
Hmm, ok. On websites that have like profiles though, entering in gibberish in the url will come up with a page saying the user doesn't exist, but those pages aren't 404s, is it still the same thing?
>>
>>54257049
those are still 404s.
you can make them look like whatever you want.
there's no difference but just responding with a different status code.
>>
>>54253218
Why would a software engineer care about javascript?
>>
>>54257069
Alright, thanks.
>>
>>54257069
Oh sorry, one more question. So if the database does contain the user, is it still a 404 page?
>>
>>54250270
>php is faster than python
"What is pypy?"
>>
>>54257211
the database has nothing to do with that, depends whatever status the page returns.
hell you can return 404 for all your pages, but good luck getting search engines indexing that.
>>
I need to create a series of complex, amorphous shapes and lines in canvas, is there an editor or something that can draw the lines and convert to coords?
>>
>>54257358
Google Chrome

testing this stuff in JS in your web browser is quick
>>
you should add ramnode to the vps list, used them for about 5 years no problems

plus super cheap
>>
>>54257436
well if it was few lines I wouldn't mind I just have to create hundreds of these and its gonna take me forever to do it manually with quadraticCurveto
>>
>>54257519
>hundreds
Would have taken you ages in a paint program.

It would help if you described what it should accomplish. imo, JS is perfect for automating this kind of functionality with a few higher order functions
>>
>>54257358
Are you trying to dynamically create random blobs, or do you just need some premade to put in the canvas?

If it's the latter, can't you just use a vector drawing program (Inkscape is free) to make an SVG?
>>
>>54257594
>>54257651
problem is the shapes are very specific and can't be generated, I need to make shapes of countries and areas inside them, I thought of just using images but its gonna be overloaded and since its only single color shapes I need its gonna be faster if drawed
>>
>>54257709
Maybe you could use gimp/photoshop/something to mess with the contrast till you get a black and white outline of the country, then turn it into an SVG from there. Also possible you could find something like that already made, depending on what you're looking for specifically.
>>
Do you guys use www for your sites?
>>
>>54257874
mysite.tld is the canonical url for my portfolio site, with www.mysite.tld redirecting to it.
>>
>>54257812
ok thanks I can make SVG easily in illustrator but aren't a bunch of svg going to make the app slow just like if I used normal images?
>>
Codeacademy is getting SASS and react.js soon.
>>
>>54258014
Codeacademy is shite though. It barely passes super-entry level
>>
>>54257957
SVGs are generally way smaller than raster images, so you'd need to be using a ton of them. Depends on what you're doing and how exactly you're implementing it though.
>>
WDG, need game writer/animators help.

I need a JS library where I can create a basic array of sprite creatures that fly across the screen with basic animation and behaviours. Think of it like making a screensaver webpage (akin to After Dark's Flying Toasters). Doesn't need to be a game, but I'm guessing a game library will be what I need unless I roll my own completely. I'm a fully employed back-end developer so I don't need baby's first library, nor do I need super-mega-everything-complicated library.

Any thoughts?
>>
>>54258042
I don't really like this site as well. They tell you what to do, but they don't explain it too much. I know it's for beginners but I'm not sure that's the best way to learn.

I'm looking for websites really teaching how things works. Like intermediate/advanced "tutorials". I guess only uni courses, personal projects and documentations would give me that?
>>
>>54258102
>but I'm not sure that's the best way to learn.
For any language, the best way to learn usually takes time to find, considering every desired tutorial is designed to be no-experience-friendly, which is awful for anyone who's already dipped their feet in this industry.

imo for SASS/react.js, I can't recommend anything, but I did just discover eloquentjavascript.net if you haven't delved too deep into JS yet
>>
>>54258087
There's a number of libraries you could use for this. You're right that a game library is highly suitable.

I recommend Phaser (http://phaser.io/), it's a fantastic game library I've used, and very easy to work with:
http://phaser.io/examples/v2/sprites/add-several-sprites
>>
just started freecodecamp, am going to couple that with codeacademy and finish everything on there as well, then make my way towards the odin project and so on. I know this is far down the journey but, approximately how long will it take for me to become competent enough to get a job?
>>
>>54258260
No point predicting, depends entirely how hard you work and your internal abilities. If you work very hard maybe a few months
>>
>>54258260
Depends on how smart and diligent you are. I would guess at least 6 months if you work hard for like 8 hours a day, but probably longer than that.

Most of those code boot camps do like 8-10 hours a week for 3-9 months and even then they don't know jack shit most of the time.

As with anything, it really depends on what you put into it.
>>
>>54258235
Nice! what options are there for creating animation scripts? I'd like animations to run separately from movement sometimes (think like a bird with a few different types of scripted movement, but could squawk and anytime, regardless of which movement script they are executing)?

I'm sure I can find out on my own, but just asking 'cause it sounds like you know the library. Thanks!
>>
what's the best method for having basic backend functions (file i/o r-w for XML or JSON for example) without resorting on any cgi method (PHP, Python) or webserver (node...) ?

trying to dig in Xquery/Xforms, REST, backbonejs but can't really find shit
>>
>>54258363
Your Sprites each contain an Animation Manager, you just add multiple Animations to that and start/stop when appropriate. Separate from movement of the sprite itself.
>>
>>54255935
It is pretty good.

See? I proved you wrong.
>>
html/css -> JavaScript -> jQuery/(jqmobile) -> ??

php or sql ?
>>
>>54258481
PHP or SQL? A programming language or a database query language? What on earth are you asking...
>>
>>54258481

-> php || ruby/rails || python/django/flask || js/node

You can learn most of what you need to know about sql in like 4 hours.
>>
>>54258514
calm down
>>54258546
will do sql when you think that it is short
>>
Is there anything smoother than Django when it comes to the communication of as many aspects of general web dev as possible?
>>
>>54258583
You mean better frameworks? Depends on the language you've chosen, Django is best for Python.
>>
>>54258476
Awesome, thanks bruva.
>>
I'm trying to send information from an input field to my database. The way I've done it now is I've hard-coded the variables with the few entries I have. How could I improve my code ? I'm working with ASP.NET
<script>
document.getElementById("myBtn").addEventListener("click", function () {
document.getElementById("demo").innerHTML = '<img src="@Url.Action("DrawPieChart", "WebTraffic", new { @countryName = "Canada" })"/>'
});
</script>
>>
>>54258875
Why does sending info to the database require you using Javascript?
>>
>>54259468
He wants to get hacked, obviously.
>>
>>54259468
what would you use?
>>
>>54259734
why not actually post data to a controller instead of using this weird image get request thing?
>>
>>54259734
A standard <form> submitting the information via a POST request, like almost every website on earth
>>
>>54259734
It's 2016 m8
>>
I can't install ffi for ruby, what am I doing wrong?
http://pastebin.com/PaFN8sBa
>>
>>54256143
I will do that. Thanks.
>>
>>54259468
That was the easiest way I could do it.
>>54259777
I am sending it to a controller and handling it there as well. The problem I'm having is I want to simplify the process. Not having to hard-code values but instead of that type something into the text box and then search it through my database. I know typehead.js is an option but I'm not that familiar with asp and js to know how to properly use it.
public ActionResult DrawChartPie()
{

AnalzyerData analyzerData = new AnalzyerData();
return PartialView(analyzerData.getChart3());
}

model code
...checkUserStatsWrapper.cmd.CommandText = string.Format("select user_country, sum(user_hits) from user_stats group by user_country");
MySqlDataReader reader = checkUserStatsWrapper.cmd.ExecuteReader();...
>>
>>54260063
Never mind, I figured my issue.
>>
>>54260103
forgot the most important part
public Chart getChart3()
{
cWebTrafficDb checkUserStatsWrapper = new cWebTrafficDb();
checkUserStatsWrapper.cmd.CommandText = string.Format("select user_country, sum(user_hits) from user_stats group by user_country");
MySqlDataReader reader = checkUserStatsWrapper.cmd.ExecuteReader();

I know the code is a mess, that's why I'm looking for help.
>>
>>54260103
so make your DrawChartPie take a string parameter, give it your getChart3 and pass it to the query.
and don't use string format to add parameters to a query, use sqlparameters.
>>
>>54260155
Thanks for the suggestion, I'll try and post results later or tomorrow.
>>
>>54259777
>>54259801
>>54259830
i wasnt trying to argue, im legimately asking. currenty my simple website which ive done as nothing more than a hobby uses php to input data to mariadb. its not information they have to enter, either. it's grabbed from the files they upload, so i dont think an html form would work here?
>>
>>54260748
I don't know how ASP works exactly, but you should be able to use a standard HTML form then collect the information from the form using either GET or POST requests.
>>
>>54247122
Ideas for a programming group name? In class we are programming a robot using JavaScript.
>>
>>54262094
SexBot9000
>>
>>54262127
Great, but I'm in a Mormon college and I doubt the professor would be pleased
>>
>>54262151
sxb9000
>>
>>54258102

It's in the OP. freeCodeCamp is what you're looking for.
>>
>>54262094

Directly Injected CSS
>>
>>54262094
javascript kiddies
>>
Can someone tell me how much javascript do I need to know to create pretty basic web application in ruby?
I want to concentrate on back end stuff i dont care about animations and shit
>>
>>54262711
none
>>
>>54262270
I'll check it out, thanks.
>>
I'm only realizing now how popular JS is.
Why did I learn PHP??
>>
can someone explain what this code is doing?
it leaves in weird stuff when printing but does make it possible to not crash every time you hit a non utf-8 character.

def uprint(*objects, sep=' ', end='\n', file=sys.stdout):
enc = file.encoding
if enc == 'UTF-8':
print(*objects, sep=sep, end=end, file=file)
else:
f = lambda obj: str(obj).encode(enc, errors='backslashreplace').decode(enc)
print(*map(f, objects), sep=sep, end=end, file=file)
>>
>>54262733
Seriously?
>>
>>54262937
Because it's not productive to chase the most popular/on-trend language?
>>
>>54262960
yes? as long as you don't mind the page refreshing for every request and not having dynamic stuff other than css hacks.
>>
File: fDAoMw8.png (352 KB, 1111x2191) Image search: [Google]
fDAoMw8.png
352 KB, 1111x2191
discriminatory sjw stereotypical propaganda against our webdev brothers
>>
>>54255787
rvm
>>
>>54247323
Don't listen to this retard >>54247391. PHP is dying, the only jobs in a few years will be for legacy applications and those will require a certain amount of experience you will only gain after those jobs are long-dead. Learn Python and Django.
>>
>>54262952
ok well I fixed it

def clean(text):
return re.sub(r'[^\x00-\x7F]',' ', text)

does the trick
>>
>>54263870
Source or go fuck yourself.
>>
>>54264297
check any job site. unless you want to work for 12 dollars an hour youre going to have to learn a real language
>>
>>54263595
Reddit!!! XD nice!!! :3


Brewery style cafeteria, amarite? Aahahaha :P
>>
>>54265288
is this a recorded post from a scene kid in 2008?
>>
stochatta.com/paint.html

paint webapp
>>
>>54266109
k
>>
Do I need to point my dns to my ip when setting a virtual host in nginx? It ain't working
>>
>>54267214
Have you forwarded / opened your ports?
>>
>>54267244
I'm using a VPS
>>
stupid question. So I'm building a website for the first time (just testing, seeing how it works and shit).

Do I have have a domain name for it to be available to other people? Or can I just type in the IP address for the server I set up?

This sounds stupid typing it out but I just wanted to double check. I know I can just do tests through localhost and what not but I want it to actually go online, just to say I put a website up.
>>
>>54267292
you can type the ip address.
>>
>>54267313
balls. thanks for the answer.
>>
>>54267292
If you are hosting the server in your own home, you need to forward the ports on your router. By default, a web server's ports are 80 or 8080. You'll have to find a tutorial relevant to your specific router, though
>>
>>54262937
Because in backend PHP is a lot more popular.
>>
>>54267403
>>54267313
Just got it. Thought I had the ports forwarded from a while ago, but the settings must have reset. Thanks though.
>>
>>54247727
nodemon
>>
>>54264297
I just checked for the jobs in my area:
>One mention of python
>One mention of Django
>Over 15 mention of PHP and a particular framework
>>
>adsense demands you add a cookie warning to your site
I don't want an ugly bar on my site. It looks like shit.
>>
>>54257212
Wait until Truffle goes stable and Ruby fucks that shit up.
>>
i want to exercise making php systems preferably with mysql
Anyone got ideas what should i do? Already done a chan ike forum, a cms and a fb clone
>>
>>54263886
That's kind of a hack anon.
Proper way would be
return text.encode("utf-8", "ignore")
>>
>>54269975
Time to create your own framework.
>>
>>54270219
But i'm still shit at it
1. Idk what kind of framework i should do
2. I want to lear mvc but i just don't know how to structure my code according to mvc pattern. Yes i know how it works but it isn't stated where and how u should pas data, what dir hierarchy should i use etc
Pls hal
>>
>>54270219
But i'm still shit at it
1. Idk what kind of framework i should do
2. I want to lear mvc but i just don't know how to structure my code according to mvc pattern. Yes i know how it works but it isn't stated where and how u should pas data, what dir hierarchy should i use etc
Pls halp.
>>
Is learning from codecademy worth it?
>>
>>54270386
not really
w3schools is better

anyway, have you ever made games in html/css/js ? is it worth.. found a guide to make floppy bird
>>
I need to protect a simple HTML form from abuse as much as possible. It's just a simple "contact us" form: you fill in your name, phone number and a message and that's it. It's just a basic form in a hand-written HTML file, nothing more. The backend is a small PHP script that removes HTML from the data, checks it's not empty and if it's still good, stores it in flat text files that another PHP file displays and allows them to be removed. That's all there is.

But I need to protect the form from abuse, ie. spamming. I've never done anything like this before, so I'm not sure where to even start. I've read about CSRF, but I'm not sure if it applies to this situation. I've also thought about keeping track of IP addresses and simply limiting each IP to, say, three messages per hour at most. But that requires a database I don't have at the moment. (That's why I use flat files.)

I was even able to spam the form with curl from the command line and that's not something I like. I want to prevent it if possible.

So what are my options? I'd rather not install multi-megabyte frameworks for this, because the whole site without images is less than 100 kilobytes total, 90% of it is static hand-written HTML.
>>
>>54270312
There's no rule because it's more of a way of thinking and organizing your code. Different frameworks using MVC may have different structure.

Simply search for PHP MVC in YouTube to find tutorials.
For example:
>https://www.youtube.com/watch?v=OsCTzGASImQ&list=PLfdtiltiRHWGXVHXX09fxXDi-DqInchFD
(don't know if it's any good)
>>
>>54270522
Why not store the IPs, the number of messages and the last attempt date in a file?

>[IP][delimiter][Messages][delimiter][LastSent]

You fetch the info, you explode the line into an array from the delimiter and you do your thing?
>>
>>54270630
I guess that could work. I'll add it to my ideas list.

Anything else I could try?
>>
>>54270666
Captcha to keep away some bots
>>
>>54270683
Of course, how could I have forgotten about Captchas? Stupid me.
>>
>>54270770
Remember not to use the reCAPTCHA, it's Googlel Botnet (tm) stuff.
>inb4 you are using it too
I have a 4chan pass
>>
Hi, I want to start a modificate the blogger CSS for my blogspost page (not kill me,pls).
This is my first proyect in "solitary", I have done other things for myself. But I don't dare to start the proyect, any help or advice?. thanks
>>
>>54270842
Use a compakt disquete
>>
How the fuck do I code a css script that finds the first line of a block div, and if it has a certain element, in this case a <br>, it hides it?

I have this problem because people post whatever they want and sometimes they put in unnecessary line-breaks, which fucks the layout. so I want to hide them with css if they're at the start or end of the div.

I tried something like .class::first-line br {display:none;} but it doesn't want to work.
>>
>>54271013
What about:

.class > br:first-of-type {
display:none;
}
>>
>>54271013
If users can post something with valid html in it in the first place, you already fucked up.
>>
>>54271138
Problem with this is that it selects br's even if they're deep into the text. Which obviously isn't what I want, br's that are inside the text are totally fine.

>>54271158
They pay for the privilege, so that's not a risk.
>>
>>54271170
Can I have a text sample? It did not select other br's in my tests.
>>
>>54271190
Really? It did for me, just tried it. And if you look at the logic you wrote, that's how it works.
>>
>>54271170
>They pay for the privilege, so that's not a risk.

>trusting the user
>ever
>>
>>54271268
can't help you without some sample
>>
>>54271013
Don't use CSS for that, use whatever backend language you're using to filter out the tags.
>>
File: wisdom_of_the_ancients.png (27 KB, 485x270) Image search: [Google]
wisdom_of_the_ancients.png
27 KB, 485x270
>>54260111
>never mind, fix'd
>>
>>54271298
This
>>
>>54271721
The worst is having a vanilla js issue, google it, get a guy from 2004ish who had the same issue, the only responses are from 2012 forward saying to use jQuery.
>>
What to put on an error page? You know, besides the error number.
>>
>>54274604
call the user a faggot for breaking your website
>>
File: Capture.png (10 KB, 450x135) Image search: [Google]
Capture.png
10 KB, 450x135
>>54274604
>>
Someone give me a simple web app idea. I have no ideas for projects and the only way I can learn is by working towards completing a project.

pls
>>
>>54274831
1 to do list app
2 blog
3a simple forum or 4chan clone
3b simple game in js using html5 canvas

you can follow the progression or not, doesn't really matter
>>
>>54274831
A video streaming site.
>>
File: 1446405865146.jpg (11 KB, 300x300) Image search: [Google]
1446405865146.jpg
11 KB, 300x300
>project managers asking clients for requirements for some data export
>dont get back to us in 2 weeks
>mesaaging them constantly since we know todays the deadline
>just got back to us and 180 the requirements
>mfw im the dev who has to pull and format shit including many-to-many-related fuckery
Doing this shit professionally is fun lads
>>
>>54274831
Web app as in only frontend stuff?
A library where you can define rooms and points where a specific temperature is and then it prints out a heatmap in a canvas.
>>
File: FCC.jpg (231 KB, 977x791) Image search: [Google]
FCC.jpg
231 KB, 977x791
>>54258260

Stay clear of FCC. It does a really good job at selling itself at first, but really that's just to bait goys into donating to pic related (which is essentially a scam so the creators can pocket money for 'consulting' services)

The biggest problem is of course that the learning material on FCC is shit.
>here's 50 tutorials on how to change colors with css
>ok now make a trello clone

Best advice is to just start with odin project. There's no faggy 'nonprofit' scams to watch out for and the learning material is the best because instead of copying shit from other websites they just link to the best material available instead.
>>
>>54274831

airbnb for dildos
>>
I just started using vagrant. Sheeeit son, this is gonna change some things.
>>
>>54274698
I do this.

"You think you're sneaky? Enjoy a ban."

They get added to the blacklist.
>>
>>54275357
FCC helped me by giving me project ideas and challenges. I did CodeCademy before it, which taught how to do algorithm challenges, but not how to actually build anything. FCC could be way better, but it got me over that hump. After the front-end stuff, though, it is completely unfinished.

The Odin Project uses ROR, right? I looked into it before FCC, but I couldn't get ROR working on Win10.
>>
File: js.png (2 KB, 141x160) Image search: [Google]
js.png
2 KB, 141x160
what resource would you guys recommend to learn javascript? I've used codecademy in the past but I don't like how much it holds your hand the entire way through and doesn't let you experiment much.
>>
>>54276252
> but I couldn't get ROR working on Win10.
Hey rorwin10-kun, good to see you. Have finally installed a VM with a GNU plus Linux distro?
>>
>>54276391
Chrome and a text editor
>>
>>54275375

airdo
skydil
dildrop

now with half hour drone delivery

we're one medical grade sanitation station away from being millionaires.
>>
>>54276391
i recommend starting with these vids (you can skip the html and css) https://www.youtube.com/watch?v=3JluqTojuME&list=PLoYCgNOIyGAB_8_iq1cL8MVeun7cB6eNc
its way better than codeacademy which you just learn dry syntax, this guy explains shit. I can make my own shit now
>>
Anyone use gulp?

Seems like a huge waste of time to me.
>>
>>54247122
I have been working on a JS slide show script.
what I had in mind was making 2 divs and loading a images into them. Then when when the user clicks next I change the width of one div and increase the size of the other. after the transition I change the position of div 1 with div 2 and load in a image into the place holder div. the problem is that when i use

$('#side2').insertBefore('#slide1');

the slides aren't moving can anyone help

        <script>

function move_slide1(){
console.log("its time!");
$('#side2').insertBefore('#slide1');
}

var top_slide = 0;
$(document).ready(function() {
$('#next_slide').on('click',function(e){
$("#slide1").toggleClass('clicked1');
$("#slide2").toggleClass("clicked1");
window.setTimeout(move_slide1, 2000);
top_slide = 1;
});
});
</script>

>>
>>54277033
have you tried using #slide2 instead of #side2
>>
>>54276847
>Seems like a huge waste of time to me.
Maybe for small stuff, but if you get to a non-trivially sized project, it's really handy to compile/transpile/minify/modify/compress/serve/etc
>>
>>54277067
it would have been something stupid like that. thanks for the second pair of eyes
>>
>>54277033
>>54277067
>>54277124


ok now I have a real problem. I made a flag called top_slide and set it to 0. Then made two if checks to see if the flag is 0 or 1.

If its 1 it runs the code, moves the divs and sets the flag to 1.

my problem is that on the second run when the flag is set to 1 it wont run the else part of the statement where it does the opposite and moves the divs back to there original state.

        <script>
var top_slide = 0;
function move_slide1(){
console.log("2 before 1");
$('#slide2').insertBefore('#slide1');
}
function move_slide2(){
console.log("1 before 2");
$('#slide1').insertBefore('#slide2');
}
$(document).ready(function() {
if(top_slide == 0){
console.log(top_slide);
$('#next_slide').on('click',function(e){
$("#slide1").toggleClass('clicked1');
$("#slide2").toggleClass("clicked1");
window.setTimeout(move_slide1, 2000);
top_slide = 1;
});
}
else if(top_slide == 1 ){
$('#next_slide').on('click',function(e){
$("#slide1").toggleClass('clicked1');
$("#slide2").toggleClass("clicked1");
window.setTimeout(move_slide2, 2000);
top_slide = 0;
});
});
</script>

>>
>>54276391
Don't listen to the others. Videos, codeacademy, random experiment through Chrome, etc is a waste of time.

What you need is reading material and practice questions, both of which you can find on eloquentjavascript.net which, personally, has taught me fastest, as not only does it go into each topic in good detail, but it is clear and goes thoroughly in detail in topics that matter. Plus its challenges are pretty tough early on
>>
>>54277437
different people learn in different ways friend. when you are talking about learning its counter productive to say my way is the best way and you need to do it like this. you should just say if videos and codeacademy aren't cutting it for you you can try [fill in the blank]
>>
>>54277489
No, you should try videos if reading isn't cutting it for you. Videos are long as hell, comparatively at least, and are counter productive as a result.
>>
>>54277512
well I'm assuming that the poster is above the age of 18 and by now has a general idea abut how he likes to learn. you should be able to present him with ways to learn and he should be smart enough to pick the most appealing to him
>>
>>54277549
If he's above the age of 18, he would be reading
>>
>>54277581
I'm 21 I like to read a lot of fiction but I don't learn well form books. Most of the time I like to read the documentation make stuff through trial and error and when i get stuck I watch a video on the concept.
>>
>>54277658
I'm not those guys but I suggest that you learn how to learn from reading. Personally, I like to watch a few high level videos about a topic, especially if I'm new to it, but after I gain a basic understanding of something, reading is by far the quickest way to learn. I suggest you try doing both and eventually switch to reading documentation pages once you have enough knowledge about something.
>>
>>54256143
And then you get a call a month later because half of the plugins had security holes and her site got hacked. Alternatively a WordPress update breaks her theme or a few plugins and her site slowly becomes unusable

I spent the entirety of 2013-2014 fixing sites like the one you'd end up making for more than they paid the original "developer"
>>
>>54256143
>t. rajeet
>>
Is it a bad idea to deface wordpress sites and then send them emails "I noticed your page is broken, I can fix it and prevent it from happening again"
>>
>>54280948
Just let someone else do the defacing. Its inevitable
>>
What's a good way to make unique names for uploaded images?


In my old gallery I had an int column named total_images.
I would get the value of the most recent one, then just add 1 to it and store the image datetime and stuff there.

I never had problems with it, but I don't know if it would break if I had large volumes of images being uploaded.
>>
>>54280983
I do actually know a few defacing communities that showcase their work.

Problem is that most of the websites were abandoned years ago.
>>
>>54281127
unix time of the upload time, then append (1), (2), ... for images uploaded at around the same time?
your current method sounds good to me until you hit the max int value.
>>
>>54281148
I just assume any popular WordPress site that was thrown together by Pajeet is going to be defaced at some point. My wallet is proof of it
>>
>>54281127
>>54281175
Most image boards just throw a few random numbers at the end. It works 99% of the time for 4chan
>>
I'm looking at some old code

lol

echo "<table cellspacing='2px' cellpadding='2px' align='center'><tr>";
while ($x < $runagainst) {
$y=0;


if ($z == 5)
{

echo '</tr><tr>';
$z = 0;
}

if (substr($files[$x], 0 , 2) == 't_') {

$thiss = $files[$x];
$linkimageext = explode(".", $files[$x]);
$linkimageext = $linkimageext[count($linkimageext)-1];

$linkimagename = explode(".", $files[$x]);
$linkimagename = $linkimagename[count($linkimagename)-2];

$imagenamethumb = substr($linkimagename, 2);


while ($y < $runagainst) {


$linkimagenamea = explode(".", $files[$y]);
$linkimagenamea = $linkimagenamea[count($linkimagenamea)-2];


if ($linkimagenamea == $imagenamethumb) {
>>
File: 3 quarters.jpg (65 KB, 1047x785) Image search: [Google]
3 quarters.jpg
65 KB, 1047x785
Learning coding for job opportunities
not sure what I want to do, just know that my current industry of employment will never pay me enough to make a real living

I'm keeping both of my jobs and trying to learn code in most of my downtime, it's been pretty fun so far but I haven't used my brain for work in a long time and I have massive respect for you goofs that code for a living now.

I'm just starting with codecademy since it's pretty casual friendly and instructive, if not a little "hand-holdy"

I went through their "java" section, which left me with a very very slightly better understanding of java, and now I'm 3/4ths of the way through their python section which has been a lot more thorough and I'm really starting to grasp it.

What's a good method for putting these coding skills under my belt studying 16-20 hours a week for a few months?

I'd like to get a job by Christmas, so should I go the webdev route?

Thanks for your patience /g/

pic unrelated, shitbike.
>>
>>54281366
make projects

>>54274859 here's a list, but pretty much anything will work. The absolute most important thing is that you have to finish (or at least complete to a presentable or functional level) your projects.
>>
I'm interning at Facebook this summer :D
>>
>>54281366
I would say to get started with javascript. Learn vanilla, then jquery, then node.

It sounds like a lot, but it's not, they are the same language just with stuff added to it.

This will take about 6 months to get a good hold on. Learn git and upload everything to github. You will need all of it. Everything that you do you put on github.

If you don't have a job by that point, then start learning Angular. It would be very difficult to not have a job after that.

First and foremost, start with HMTL/CSS because those are required for every job. You should be able to learn them well enough in 1 month or less.

I see you are doing Java and Python so I'm not sure if you mean to be here or in /dpt/.

but basically yes, it will get you a job before Christmas especially if you're willing to relocate.
>>
>>54281488
>proud of joining normies enslaver
jfwu good luck mate
>>
>>54281594
they pay $200k to new grads.......

www.dropbox.com/s/ges24saz61d7e4h/2016%20Full-time%20and%20Intern%20Offers.xlsx?dl=0
>>
>>54281599
This makes me sad desu. I'm not even graduating from a top school in the US, they'll fucking overlook me like I don't even exist if I were to even apply to be a janitor at any of these places.
>>
>>54281741
I go to a no-name school in the south and I'm a freshman. I promise, it's not as hard as you think
>>
I'm off for 4 days straight.

If I don't get my image uploads to be tied to user accounts and watermarked in that timeframe then I'm sudo king.
>>
If i want to learn something relevant what should i learn?
What has a future?
>>
>>54282807
Most client-side technologies. Angular/Angular2 is what I think is the best thing to learn right now.
>>
so what should I put in the robots.txt ?
>>
>>54281765
>At least you're not from a third-world Caribbean country in the final year of college getting a degree that is supposedly "internationally accredited" but with a bang average 3.0/4.0 gpa while hoping to move to Canada soon because there aren't any jobs out here and I don't even fucking know if anyone will want to hire me and they probably won't when they realize I'm just some socially awkward 20 something dude that is relatively good at web dev and other basic IT shit and whose been through some shit in his life but is willing to work 3 times as hard as anyone else just to make a decent life for myself
So yeah, things could be worse.
>>
>>54283148
Is it cheap there like India where they can survive on 2 dollars an hour? I would sell Caribbean stuff to US/EU/CA/AU for tons of bucks.

We love the tropical shit. Don't know a major Caribbean export, but I would get some and meme the fuck out of it. TAKE SOME PARADISE TO YOUR KITCHEN WITH CARIBBEAN COFFEE.
>>
>>54283148
Jeez......
>>
>>54283148
Well maybe you should have thought about that before you decided to be poor.
>>
>>54283616
>Is it cheap there like India where they can survive on 2 dollars an hour
I could just about manage not to starve to death with that. Technically I could 'survive' on it but that's no sort of life I want to live.

The only reason I started freelancing is because I really like web development. I've had my personal website up for about 3 months now and so far I've gotten one internship offer from a company here that I couldn't take because I'm a full-time student. Apart from that I haven't had a sniff. I've made countless applications to companies abroad (mostly in Canada) with the hope that one of them will show some sort of interest. I would be willing to work remotely if needs be, but what I really want is for them to offer me a job so I can get a chance to move there permanently.
Sometimes I laugh when people crack 'pajeet' jokes but it took me a while to realize that I'm basically a pajeet too.

>>54283616
>I would sell Caribbean stuff to US/EU/CA/AU for tons of bucks
Everything has already been exploited to death by corporations both locally and abroad.

I don't even know why I'm talking about this lmao.
>>
>>54281328
This is literally every PHP script written without a framework
>>
File: 1417059721803.png (151 KB, 1680x1050) Image search: [Google]
1417059721803.png
151 KB, 1680x1050
I'm just making a small blog with Node/Express, and I'm doing user stuff right now.

Is the best way to store passwords with bcrypt? I know I can do OAuth2, which I'm also going to implement, but I'm just making sure I don't fuck up somehow
>>
where should I get started? html 4.0/older versions, html 5, css, javascript or some other web/web programming language(s)?
>>
>>54284085
Depends what you want to do.

Html5 is the standard, don't even worry about older versions. Css is for styling all your html documents, and Javascript is to create functionality.

Honestly, just play around with Html/Css for a couple days. Make a few things, it doesn't matter if they're bad. Then move onto Javascript as well, and see what you can do with that. Once you know these 3 things well, it all depends if you want to do frontend/backend
>>
>>54284065
Are you following a tutorial? Because I could really use a good one.
>>
>>54284167
Eh, not really. I more just follow a bunch of tutorials all together and mash them into one thing.

I've skimmed through http://zellwk.com/blog/crud-express-mongodb/ just now, and it seems to be alright. All you really need to learn is how to make a CRUD application. Then once you have that, authentication/authorization.

Are you stuck somewhere?
>>
>>54275375
>been deving that app for 3 months now
scraped
>>
>>54284040
I was more talking about the variable names.
>>
>>54271158
Not if he properly sanitizes it.

>>54271190
>>54271334
>sample
He probably means something like:
<br>
blah blah
<br>
blah blah
<br>

the first and last br should be hidden, but for this:
blah blah
<br>
blah blah

the first br shouldn't be hidden. first-of-type will select the first br, regardless if it's the first element or not.

Now assuming "blah blah" is in it's own element (such as a <p> or <span>) then:
.class > br:first-child, .class > br:last-child {
display: none;
}

will work. However if you just have text nodes that are not inside a child element, you can't detect that with css. None of the selectors (https://www.w3.org/TR/css3-selectors/#selectors) provide that ability
>>
>>54284331
The variable names are the least of that script's problems
>>
>>54284370
Explain.

Is it because the PHP page puts out HTML instead of being back-end like it should be?
>>
>>54274909
>PM's fault
>not hanging that around the PM's neck and letting him drown.
>>
>>54283148
look into H1Bs, get a master's in the U.S. or something idk
>>
>>54277394
Your out of order

Document ready (done once) ->
if (toggle) ->
Bind click 1.
else
Bind click 2.

click event (done multiple times) ->
move_slide1
flip toggle

The other click event is never bound, and move_slide2 is never reached


Do you see how your toggle no longer matters? the click event doesn't have an if statement based on the toggle. Refactoring the logic to make sense:

Document ready ->
Bind click

click event ->
if (toggle) -->
move_slide1
else
move_slide2
flip toggle
>>
why do people act like learning a language is super difficult? It's easy as piss once you know one.

Particularly BASIC, java, javascript, python, c# are all very similar
>>
>>54284505
Oops. *You're

anyways, here is a fix that should work:
$(document).ready(function() {
$('#next_slide').on('click',function(e) {
if(top_slide == 0) {
$("#slide1").toggleClass('clicked1');
$("#slide2").toggleClass("clicked1");
window.setTimeout(move_slide1, 2000);
top_slide = 1;
}
else if(top_slide == 1 ) {
$("#slide1").toggleClass('clicked1');
$("#slide2").toggleClass("clicked1");
window.setTimeout(move_slide2, 2000);
top_slide = 0;
}
});
});


That has a bunch of duplication, so it can be refactored more:
$(document).ready(function() {
$('#next_slide').on('click',function(e) {
$("#slide1").toggleClass('clicked1');
$("#slide2").toggleClass("clicked1");
console.log(top_slide);
if(top_slide == 0) {
window.setTimeout(move_slide1, 2000);
top_slide = 1;
}
else if(top_slide == 1 ) {
window.setTimeout(move_slide2, 2000);
top_slide = 0;
}
});
});


Rather than an explict 0/1, just do a true/false:

var top_slide = false;
$(document).ready(function() {
$('#next_slide').on('click',function(e) {
$("#slide1").toggleClass('clicked1');
$("#slide2").toggleClass("clicked1");
console.log(top_slide);
if(top_slide) {
window.setTimeout(move_slide1, 2000);
}
else {
window.setTimeout(move_slide2, 2000);
}
top_slide = !top_slide;
});
});
>>
>>54284543
>once you know one

what if you don't know one?

And yes, most C style languages are all fairly similar
>>
>>54284578
move_slide1 and move_slide2 kinda redundent, and so is that if, so merge that into one:
function move_slide(top_slide) {
$('#slide' + (top_slide ? 1 : 2)).insertBefore('#slide' + (top_slide ? 2 : 1));
}

var top_slide = false;
$(document).ready(function() {
$('#next_slide').on('click',function(e) {
$("#slide1").toggleClass('clicked1');
$("#slide2").toggleClass("clicked1");
console.log(top_slide);
window.setTimeout(move_slide.bind(null, top_slide), 2000);
top_slide = !top_slide;
});
});


However, that's pretty ugly. Especially if more slides were to be added. This requires you add a class "slide" to each slide, but ends up being much nicer. Replace "move_slide" with "rotate" which will take the last and always insert it before the first, then just call that function.

$(document).ready(function() {
$('#next_slide').on('click',function(e) {
var slides = $(".slide");
slides.toggleClass('clicked1');
window.setTimeout(function rotate() {
slides.last().insertBefore(slides.first());
}, 2000);
});
});
>>
>>54277437
I'm not sure I'd agree that all that stuff is a waste of time, but eloquentjavascript.net is the fucking best. It breaks everything down intelligently and also teaches you good practices in the process
>>
>computer dies with my SSH key
>set root to SSH key only
>Can't access terminal from digitalocean website

Fuck.
>>
>>54281127
Whats wrong with primary key? You do have it and its numeric right? Also guid.
>>
Which developer skill on codeacdemy should I start first. I don't know anything about coding at all.
>>
>>54286211
html > css > javascript > php
>>
Hey /g/.

Help me solve a quick problem.

I need to display the current page name in the menu.

The menu is in a seperate container from the one where ng-view view switching happens.

I want the page name to be stored in HTML in ng-init in each of the views I have for my single page application.

How do I accomplish this? AngularJS btw.
>>
Hi /g/. I have an odd Wordpress related question that probably needs some jank php to make operational. Basically, what I'd like to do is display the category associated with a post, except NOT display one of the categories because it's obvious. The context is that there's a category built specifically for featured posts, but that category can be applied to a post within any category that the site owner wants to highlight. It would be silly to say "here are all the featured posts" and then display underneath that "category: featured."

Any ideas /wdg/?
>>
>see google's interview questions for front-end SE
>lose all hope

Shit, I'm not a CS student and I didn't learn algorithms and my maths/physics were just in a first year, a little above high-school in terms of difficulty.

>invert string in place
Don't know
>write some algorithm based solution and explain how would you make it scaleable
Don't know
>reverse linked list
Ok, I can always google this and it seems easy but never worked with that, so...
I wouldn't know
>Write your own atoi()
Don't know
>Write a tic-tac-toe in 35 minutes
I don't know

And these are all just the first stage questions to prove you are not retarded.

I would know questions based on web technologies and about HTML, CSS, JS and some backend (though desu, I'd have to refresh my JS knowledge) because that's what I had in my college, practical stuff.

And then depression kicks in when I realize that I don't actually really care about any of that, and when I make a web project, 90% of the time I spend designing UI. Shit, but I didn't have much graphic design courses either so I guess I would be fucked for that position too.

FML I feel I fucked up.
>>
>>54284065

yes, bcrypt is fine although it looks like the npm version isn't supported any more

so maybe bcryptjs
Thread replies: 255
Thread images: 11

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.