KevinM1
Moderators-
Posts
5,222 -
Joined
-
Last visited
-
Days Won
26
Everything posted by KevinM1
-
w3schools is filled with inaccurate information. Click on the link in my signature for more details on that. They also neglect to discuss best practices. For some languages, like JavaScript,, what they show is the exact opposite of how the language should be coded. I'm not exaggerating when I say that myself and the other staff can tell when a member has 'learned' from w3schools. The same kinds of gross misunderstanding happens across the board. You're better off with other resources. We have several sticky threads in our sub-forums with links to good alternatives.
-
How to Weed Out the Good Books from the Bad Books?
KevinM1 replied to chaseman's topic in Miscellaneous
Amazon reviews can be misleading. I normally try to only buy products that have a decent number of reviews, as the quantity of reviews helps to remove the outlying scores from consideration. You can feel pretty confident in a product that has 125 out of 170 four and five star reviews. It's not a foolproof method, but it works well enough for me. When that fails, I generally try to compare scores across websites, and if it's a technical book, see if any blogs mention/review it. -
Simple question, how to make javascript work with mutliple rows?
KevinM1 replied to Jason28's topic in Javascript Help
Remember: an ID is unique. Logically, you can't have one id shared by two elements. JavaScript knows this and is only grabbing the last one, since to it it's the most recent one. -
Simple question, how to make javascript work with mutliple rows?
KevinM1 replied to Jason28's topic in Javascript Help
The main problem is determining which elements you want to apply the event to. There are a variety of ways to do it, but it depends on what you actually want to do with the actual elements in your document. There's no single answer for all cases. So, if you have a particular problem, show more code. -
Looking for a more efficient to find and process multiple IDs
KevinM1 replied to cyberRobot's topic in Javascript Help
You could grab all <ul> elements via getElementsByTagName, then search through those using regex on their ids, storing the matches in another array. That would allow you to add/remove menus without having to hard code the number of them in a for-loop. You could then simply loop through them like: for(var i = 0; i < menus.length; ++i) { menus[i].style.left = "-999em"; } It takes more upfront processing, but it's a more elegant solution overall. -
If you're submitting to a form, and the form's action is blank, the page will refresh automatically.
-
Use tags to display your code. I put them in for you this time.
-
Simple question, how to make javascript work with mutliple rows?
KevinM1 replied to Jason28's topic in Javascript Help
Multiple rows of what? -
No, the best thing to do is fix the error. Saying "I have a large system, it's too hard" is an excuse for not testing and releasing a buggy site.
-
getName RETURNS the value. It doesn't echo it.
-
You never call setName, so $name has no value.
-
Ideally, your HTML, CSS, and JavaScript should largely be a skin you place on top of the PHP script, which is the part of the system that's actually doing work. This allows one to work with one component without worrying about screwing up the others. One of the traps newbies fall into is mixing and matching PHP and HTML in large quantities in the same files. The problem with that approach, as you're starting to see, is that your site logic gets tangled up in what you need to do in order to simply display your site. There's a term which denotes a best practice - Separation of Concerns. PHP largely shouldn't be concerned with HTML, nor should HTML markup be concerned with CSS, etc. Each component of your system has a clearly defined responsibility, and it should only be focused on that responsibility. Achieving this separation requires discipline on your part. It's impossible to have complete separation - you'll need to write a little PHP in your markup to display processed values, for example - but the goal is to keep each component as separate as possible, with communication between application layers happening only when necessary through explicit channels. To achieve this separation, you need to use modern techniques: external CSS, unobtrusive JavaScript, and take care when you exit PHP for HTML markup. Separation of concerns promotes what is known as loose coupling. Coupling is how tightly related your components are to each other. Gauging coupling is as simple as figuring out if a change in one part of your system will necessitate a change in others. Tight coupling is what you're currently experiencing. You can't make non-trivial changes to your site without changing a bunch of other things in seemingly unrelated places. Well-formed PHP apps do all of their processing upfront. When the results of that processing are available, the script(s) then redirect the user or displays the proper thing based on those results. Since you apparently have a due date of sorts, it's your call to figure out how to best spend your time and discover what to do to best get you to the next stage. Long term, fixing your site architecture is paramount. It will make subsequent updates to the layout so much easier.
-
Until your site validates, you shouldn't have validation icons on it. I think you should change your color scheme. The dark gray gradient bars look somber, and make any text on them all but unreadable. You should look into tightening up your site navigation. It's disjointed, for one (do you really need to tell people about your incremental updates if the site is for 'professional' developers? Why is it necessary to have links above the header image?), and none of the links stand out. If you're going to keep the horizontal bars, look into making navigation buttons. They're fairly simple to make with just HTML and CSS, and you can make them dynamic by adding a hover state to them. You need to fix the header image itself. It looks flattened. And get rid of the under construction image. I'm wondering why you want to show random members' avatars/images on the home page. They don't really say anything about the site itself, and certainly don't entice someone to join. You need to remove the big, blue buttons from your forum pages. As a developer, you need to be able to step back and look at your site as a whole. Everything needs a purpose. As proud as you may be about certain bits and pieces, if they don't fit into what the site should be, or if they're superfluous or distracting, you should change or remove them. A good developer knows when to edit their work. It takes a while to get good at it, but you should always try to divorce yourself from whatever emotional attachment you may have so you can use a critical eye. Something else to remember is that when you put a project up for public consumption, there will be criticism. That criticism will be blunt. Getting angry and defensive only reduces our inclination to help you. You asked for our honest opinion. We gave it. Your site is very antiquated (to put it delicately). Putting the word 'Professional' in it only exacerbates the problem, because, as developers, we have a very clear idea of what professional is. This site doesn't even come close to meeting the bar. Something like this shouldn't even be on a live server for all to see, given its unfinished state. For the most fundamental problems, I suggest getting updated learning resources. Get the HTML 4.01 spec and the CSS 2.1 spec. Learn how to size and position divs. Learn the box model (Google it), and go to Smashing Magazine for inspiration. Above all else, take a good, hard, critical look at existing sites. The one criticism we've all shared is that your site looks incredibly dated. And it really does. It's as if you dabbled with websites in the late 90's and never really looked at how they've changed and matured over the last decade or so. Look at the commonalities modern sites share in terms of layout, color, navigation, etc., and contrast that with where you are now.
-
It's far simpler to just give your check boxes the same name with an array indicator, like so: <input type="checkbox" name="drinks[]" value="Coke">Coke</input> <input type="checkbox" name="drinks[]" value="Pepsi">Pepsi</input> You'd then get an array which is only filled with the checked values: foreach($_POST['drinks'] as $drink) { echo $drink; }
-
I work in both C#/ASP.NET MVC and PHP, and I don't feel bad or conflicted. Just realize the strengths and limitations of each. Being solid in both open source and Microsoft development simply means you have more employment opportunities waiting for you.
-
You mean JavaScript. Java is an object oriented language which runs on a virtual machine. It was created by Sun Microsystems. JavaScript is a scripting language which runs in a browser. It was created by Netscape. Aside from the name, which was Netscape merely trying to jump on board the hype Java was getting at the time, the two languages have nothing to do with one another.
-
Also, your conditional is messed up. Aren't you trying to format the numbers less than 10?
-
While the var keyword can still be used, it's a sign of PHP 4's OOP mechanism. Var gives a default visibility of public to the data member it's associated with. You're much better off providing the appropriate visibility modifier - public, protected, or private - depending on your needs.
-
Thanks, but unfortunately, it's pretty out of date. .NET gets upgraded every 2 years or so, and that article was written while LINQ was in development. It also isn't referring to the PHP version, which is simply a bunch of utility classes someone else wrote, and not baked into the language itself like it is in VB and C#. Thanks for trying, though. Once I get some free time, I'll just run a few benchmark tests myself. I'm wondering if it will be able to sit on top of PDO. That would more closely mimic how LINQ works in .NET, where it sits on top of various data service providers. That way, you get the same unified API regardless of what kind of data you're trying to manipulate. If it doesn't/can't sit on top of PDO, that may be an interesting side project to undertake.
-
LINQ is probably the best thing to come out of Microsoft, programmatically, in years. It's so easy to shape results from what would otherwise be horrific SQL statements, or odd contortions of sort/search code when dealing with objects. The only downside, really, would be the overhead. It generates the horrific SQL and sort/search statements for you behind the scenes, so I'm sure there's a performance hit. I just don't know how bad it is.
-
Why don't you post some relevant code and your database table structure? Telepathy isn't a forum feature (although I hear CV is working on it after the success of the Auto Solve button).
-
Not only that, but the majority of the problems I listed in the last two threads you started remain. You're going to need to spend more than 15 minutes on this. Adding a free CSS template doesn't address your core problems.
-
+1 for not understanding the aesthetic at all. The dark and angry vibe is actively repelling me away from the site.
-
They're commodities, so yup. Precious metals, at least, change daily. Not sure about others.
-
C++ I bought a time machine and want to learn it
KevinM1 replied to cssfreakie's topic in Other Programming Languages
Yup, those are the ones.