CuckOverflow attacks and downboats me every time I ask something. What's the point of this elitist circlejerk if they won't even help beginners with coding?
I just wanted to know how to write a simple PHP code like this in Ruby on Rails:
$urls = array (
$random = mt_rand(0, count($urls) - 1);
header ("Location: ".$urls[$random]);
Appearently that deserves -6 in 5 minutes.
StackOverflow isn't for straight beginners, they make this quite clear. It's okay to be a beginner and ask questions, but one of the big, bolded things it says when you ask a question is to 'make sure you've researched and tried to solve the problem on your own'. They want questions that people can reference in the future, should that question arise again. They DON'T want people asking the same question over and over again that's been answered a million times.
Also, while occasionally asking for help on a particular problem isn't bad, becoming dependent on it makes you a bad software developer. It's important to know what you're working with and be able to come up with solutions on your own, as opposed to having your entire code base be a patchwork of copy/pasted SO code.
Read the rules of SO, faggot. As an active user, you can't imagine how much shit we read every day. Also, if the question is formulated correctly, it doesn't get downvotes, even if it is retarded question.
I'm unable to understand any coding beyond HTML/CSS
I'm okay with my website being a patchwork. I just want it to work. I'm not trying to be a programmer. I just need to code some specific things.
yeah, mate, SO won't do your homework for free.
Stop criticizing people just because they refused to do your own job. Quick rules:
1. Google beofre posing
2. Post a piece of code that shows you have tried solving the problem and failed.
3. Post what doesn't work in your code.
>How do you even search code like this
You search for whatever the hell it is you're trying to do. You don't just post the code, expecting people to figure out what you're trying to do.
OP didn't explain shit. From the code, it seems it's trying to make a script that feeds you a random url from the array of html pages.
(0. "ruby example code")
1. "arrays in ruby"
2. "ruby random element from array"
3. "ruby visit site"
That's what I would do if I had to write OP's code in a language I never heard of before
You may want to try a traditional forum, quite possibly the QTDDT or DPT on here might give you some assistance. StackOverflow isn't really meant to be a 'help desk' of sorts, the mindset of the community, and website as a whole, is that it's very academic.
It's fine to be a newbie and not immediately get shit, we were all new at once, but StackOverflow isn't the place to ask new, redundant questions.
>How do you search for code like this.
You're not searching for 'code', per se. You have a problem, you need a solution to that problem in a given langauge/setting. So your first step would be to enter something into google like..
"(What I want to do) in (What language I need to do it in)"
Omitting the "in" is optional because google really doesn't give a shit.
Can't you see? I still wouldn't understand. My PHP code is made by pure luck. I barely understand it myself.
You need to understand a few things..
- Most programmers don't work for free, a lot of them do it as their job. Most people who do something as their job, really don't want to spend their free time doing it for free. Much like being a mechanic, outside of a good project or two, you don't want to see your job when you get home.
- Do you plan on maintaining this code in anyway? What you need to add/fix something? To do either of those things you need to understand your code.
A huge part of coding, and I mean huge, is learning how to solve problems yourself. Even if you're completely stuck in the water with no direction, you've got to learn how to obtain direction and figure it out, even if that means just plugging in shit in a futile attempt to get something to work, you'll often learn just by doing that.
So find a living person that would help you. Attend a class maybe. Communities you so much dislike for not helping you were not made for helping people like you in the first place.
It's my index.php. I need it in Ruby because I'm done ith PHP, and if I can see how this works in Ruby, then I can maybe figure out how to change my other PHP stuff to Ruby as well
I think what these anons are trying to say is that you, as a developer/programmer, should spend time doing extensive research before asking such simple questions. If you haven't found anything after hours of research, go back and look at your code. Then research more.
>code doesnt work
>guess i'll switch to another language
Yes, because you're doing something different with your code..
Honestly, before you try fucking around with code in ANY capacity, it's paramount that you can take an example of what you're trying to do and piece it together in such a way it'll work for your situation. That's a problem solving skill on par with opening a jar..
i dont know what you're expecting outside of someone literally doing it for you
Who helped you put on your big boy pants today?
Disclaimer: I don't know Ruby, nor have I ever tried it.
urls = ["1.html", "2.html", "3.html", "4.html"]
request.add_field 'Location' urls.sample
Retards can figure this shit out you bloody degenerate
Here you go nigger, it would be the highest but the other guy wrote a fucking book.
I fucking despise reddit, *overflow and all sites which employ a reputation system then ask le tricky questions to boost their reputation.
An invisible hand of Q&A exist in a free market without reputation system:
>anyone can ask any question (even if it's duplicate)
>anyone can answer any question (even if it's easy or already answered)
>the questioner benefits because he earns knowledge from the solution of the issue.
>the answerer benefits because answering duplicate questions refines his knowledge
It doesn't matter if a question was asked by a senior with 15 years experience, Pajeet, or a 12 year old trying to make his video game in C++. It doesn't matter. If you have a problem, you ask to get a solution. You don't ask questions to get responses like "OMG this is so le tricky xD dunno the solution, but I like the question!" and this is what these sites encourage and consider a good question.
Just imagine grade math teacher teaching math with "Just google the solution dumb kids, all the answers are there!", and only the autistic nerds asking about degenerate cases no one ever thinks about or cares about get an A.
I exclusively ask stupid beginner questions on SO, since I am a stupid beginner.
Also, I never really learned programming in general, or the language I use.
Yet, I only got one or two downvotes so far, but even those questions have always been answered quickly and thoroughly.
>Explain WHAT I want to do and WHY
>Explain what I tried, where I am coming from and what I researched in order to answer this question myself
>Give some ideas, suspicions of where the error might be, or what direction I think the answer would be
>Give some well formated code example + (erroneous)output
>Be polite and write in clear sentences
>The fact that an epin joke got 42 votes just goes to show how much of a fucking joke that site is.
No, it does not. I don't know where you're getting this.
And you are a retard. Before I was just throwing empty insults to shame you for making a statement you know to be false. After your complaint about math, I can see with clarity that you need medical assistance.
Points free system is the opposite of a free market
In a free market, people are driven by their desire for money. This can lead to great things and despicable things. But all of these things have in common that they were not done for the sake of the thing or its inherent effects, but for money
Same shit applies when you have upboats and people start chimping out the way you described
It's not the fact of the place or who x person asks, it's the fact of pure laziness when it comes to simple questions. Sure, the question may not be simple for x person but that's why you should ask the simple questions in the right places to the right people. Not on forums such as Overflow.
I can't speak for Reddit, but as explained earlier - StackOverflow is very clear in it's goals. They don't want people coming in, asking a redundant question that's been answered a billion times. Making a programmer who just asks 'HOW DO I SOLVE PROBLEM, K?" and then spoon feeding them the answers makes shit programmers. You bitch and moan about "muh meme points and rep D:::" and "omg dont give me trivia quesstions spoon feed me plsX DDD" when that is the kind of shit that makes shitty programmers and pollutes the community as a whole with idiots.
Complaining about StackOverflows mindset, when they make it so fucking clear when you sign-up, is quite literally like going to a Chinese restaurant and complaining they serve Chinese food. If you don't like actually making yourself a not shit programmer, then go be a complete fucking retard somewhere else.
That example doesn't mean anything; the only thing score actually matters for is ordering and replies are presented in correct order in that example. There literally is no problem on that page.
>Making a programmer who just asks 'HOW DO I SOLVE PROBLEM, K?" and then spoon feeding them the answers makes shit programmers. You bitch and moan about "muh meme points and rep D:::" and "omg dont give me trivia quesstions spoon feed me plsX DDD" when that is the kind of shit that makes shitty programmers and pollutes the community as a whole with idiots.
Right, instead of asking how something is actually done, a good programmer goes around google searching for similar questions, copypastes the parts of solution he doesn't understand to his code (beacause nobody got to explain to him how it works), and mashups a hideous monstrosity that somehow just werks and he calls it a day.
And there's your "good programmer" (of PHP perhaps)
A good programmer won't have to refer to StackOverflow every 5 minutes to solve every problem they encounter, they will understand basic programming concepts/the technologies they're working with enough to be able to productively and effectively solve the problems they need.
Even if they do need to research to solve an issue, a good programmer can utilize the already NUMEROUS available resources available to solve their problem. Maybe even read some pseudo-code, know how to apply it, and optimize it for their situation.
What you're advocating is poor, spoon-feeding practices. It's that simple.
Here's something, have you yet failed to realize that what you're posting about is NOT StackOverflow and that each StackExchange site has it's own independent team of moderators?
It's hardly 'moving the goal posts' when your goal posts were on another fucking field entirely.
>they have different moderators, it's not even the same site!!!11
It's in the same network dumbass. That's like saying fucking /g/ and /v/ are sites "because they have different fucking moderators."
wow this is sad. you should just end it op. end it with a semi colon
I think this is complaining about jQuery specifically, since its not usually translatable, and also since lisp is a completely different style of programming it won't help at all. It's a shit joke but it's kinda relatable.
Which is why people don't downvote them. Whenever I encouter a question first thing I ask myself, "has this been answered before here?"
If the answer is yes, I downvote, if it isn't I either answer it myself or, if I find that I don't know, try to contact someone who might know so they can answer it.
All these replies and no one answered this poor anon's question
well first of all I'd rewrite this like<?php
$urls = ['1.html','2.html','3.html','4.html'];
which if people still don't understand, picks a random element of that array of html files and sets an http header redirecting the client to that html file.
In Ruby, hold on let me google...
The random array element method is apparently called "sample" sourls = ['1.html','2.html','3.html','4.html']
random = urls.sample
No idea how to set headers directly in rails though...
ok so add above then thisresponse['Location'] = random
into your controller.
The point of Stack Overflow is not discussion or education. It's a knowledge base to supplement official documentation and unofficial forums and mailing lists. Questions that have multiple answers may be useful, but do not belong on their site.
OP, you are seriously fucking retarded. Go sparrow a book if you can't afford it.
>hurrdurr this is my only chance not to be poor
Shut the fuck up. If you can't do this simple task, then this isn't a chance at all. Go do manual labor, you borderline monkey.