• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
[QUOTE=Sylerr;45316365]What's a good reliable to too expensive website host? Looking to host my portfolio on a wordpress platform or should I just go for go daddy[/QUOTE] GitHub and Heroku are free. [editline]7th July 2014[/editline] Can't use GitHub for Wordpress, but Heroku works with it.
[QUOTE=supersnail11;45321902]GitHub and Heroku are free. [editline]7th July 2014[/editline] Can't use GitHub for Wordpress, but Heroku works with it.[/QUOTE] Openshift.com is also great.
Is Rails for Zombies still a good place to learn RoR? Any other places you would recommend?
Quick question about database design. Say for example I'm storing expenditures for a budgeting site, would it be better to: A.) Have a single table with all expenditures for all users, then search for corresponding entries where the owner's ID is the same as the logged in user B.) Have a separate table for each user. Ex, user1_expenditures, user2_expenditures, etc. Basically would a table like example A be slower to query if there were a lot of entries in it for multiple users because it has to go through all entries? Or does it query them in a more efficient way that wouldn't be slow?
[QUOTE=Cep.;45346992]Quick question about database design. Say for example I'm storing expenditures for a budgeting site, would it be better to: A.) Have a single table with all expenditures for all users, then search for corresponding entries where the owner's ID is the same as the logged in user B.) Have a separate table for each user. Ex, user1_expenditures, user2_expenditures, etc. Basically would a table like example A be slower to query if there were a lot of entries in it for multiple users because it has to go through all entries? Or does it query them in a more efficient way that wouldn't be slow?[/QUOTE] Definately not one table per user. On a side note, good eCommerce software?
I'm trying to learn Angular.js Where can i find good and free tutorials?
[QUOTE=Cep.;45346992]Quick question about database design. Say for example I'm storing expenditures for a budgeting site, would it be better to: A.) Have a single table with all expenditures for all users, then search for corresponding entries where the owner's ID is the same as the logged in user B.) Have a separate table for each user. Ex, user1_expenditures, user2_expenditures, etc. Basically would a table like example A be slower to query if there were a lot of entries in it for multiple users because it has to go through all entries? Or does it query them in a more efficient way that wouldn't be slow?[/QUOTE] If im understanding it right, you would want to have a table for users, one for expenditures and maybe a third one to link a user with an expenditure
[QUOTE=tisseman890;45347247]I'm trying to learn Angular.js Where can i find good and free tutorials?[/QUOTE] [IMG]http://i.imgur.com/KJ3Fi6C.png[/IMG]
[QUOTE=Cep.;45346992]Quick question about database design. Say for example I'm storing expenditures for a budgeting site, would it be better to: A.) Have a single table with all expenditures for all users, then search for corresponding entries where the owner's ID is the same as the logged in user B.) Have a separate table for each user. Ex, user1_expenditures, user2_expenditures, etc. Basically would a table like example A be slower to query if there were a lot of entries in it for multiple users because it has to go through all entries? Or does it query them in a more efficient way that wouldn't be slow?[/QUOTE] users table (user_id, name, email) expenditures table (id, user_id, description, amount) So for a single user's expenditures [code]SELECT description, amount FROM expenditures WHERE user_id = 34[/code] For all users' expenditures [code] SELECT users.name, expenditures.description, expenditures.amount FROM expenditures LEFT JOIN users ON expenditures.user_id = users.user_id[/code] [editline]10th July 2014[/editline] [QUOTE=Richy19;45347366]If im understanding it right, you would want to have a table for users, one for expenditures and maybe a third one to link a user with an expenditure[/QUOTE] A link table would only be necessary if one expenditure can have multiple users.
Has anyone had any problems with this error? ERR_CONTENT_LENGTH_MISMATCH I cannot seem to find a solution anywhere.
[QUOTE=smithy285;45348152]Has anyone had any problems with this error? ERR_CONTENT_LENGTH_MISMATCH I cannot seem to find a solution anywhere.[/QUOTE] It means your server isn't configured right and it's sending a content length that doesn't match the content. Try giving the server user read permission on the website files and see if that works.
[QUOTE=Richy19;45347366]If im understanding it right, you would want to have a table for users, one for expenditures and maybe a third one to link a user with an expenditure[/QUOTE] Just for the sake of being thorough.. The third table is ONLY needed if users can have multiple expenditures AND an expenditure can belong to multiple users.
[QUOTE=KmartSqrl;45348766]Just for the sake of being thorough.. The third table is ONLY needed if users can have multiple expenditures AND an expenditure can belong to multiple users.[/QUOTE] My bad, forgot that only applies to a Many-to-Many relationship
[QUOTE=Richy19;45348884]My bad, forgot that only applies to a Many-to-Many relationship[/QUOTE] Thought you might have known already haha. I just wanted to make sure anyone else reading through would know that bit too :)
I could use some help with text areas. So basically I need to track if someone accessed a page and pass that to a text area which is hosted on a separate page, but I want to handle it server-side so the client doesn't actually have to visit the log page which holds the text area for it to update. For example: Client-A accesses Webpage A which is separate from the textarea. Data is immediately sent to Webpage B and updates the textarea. Is there any way to do this? Or does a client have to visit the page for it to update? [editline]Edit: [/editline] If not, would it be possible to use a quick header(logs.php?datagoeshere&destination=index.php) and check if there's $_GET data, and if there is, use another header to the page the user was originally going to?
[QUOTE=WitheredGryphon;45351593]I could use some help with text areas. So basically I need to track if someone accessed a page and pass that to a text area which is hosted on a separate page, but I want to handle it server-side so the client doesn't actually have to visit the log page which holds the text area for it to update. For example: Client-A accesses Webpage A which is separate from the textarea. Data is immediately sent to Webpage B and updates the textarea. Is there any way to do this? Or does a client have to visit the page for it to update?[/QUOTE] Node.JS and websockets would be the best way to do this.
[QUOTE=TrinityX;45351969]Node.JS and websockets would be the best way to do this.[/QUOTE] Thanks, I'll look into it. Haven't really worked with Node.JS so hopefully it won't be too hard to incorporate.
[QUOTE=WitheredGryphon;45352036]Thanks, I'll look into it. Haven't really worked with Node.JS so hopefully it won't be too hard to incorporate.[/QUOTE] If you're running nginx it's really easy to incorporate. vhost: [CODE]location /socket.io { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_http_version 1.1; proxy_pass http://localhost:3000/socket.io; }[/CODE] Replace [B][url]http://localhost:3000[/url][/B] with the local address to the node.js daemon (http:// included).
Any recommendations on a backend framework to learn for a personal project? I want to avoid PHP it at all possible. I know a little bit of Python, so I'm tempted to try Django - but are there any other worthwhile alternatives?
Flask is pretty good if the project isn't very big.
[QUOTE=HarryG321;45352712]Any recommendations on a backend framework to learn for a personal project? I want to avoid PHP it at all possible. I know a little bit of Python, so I'm tempted to try Django - but are there any other worthwhile alternatives?[/QUOTE] Play, Rails, Node.js
[QUOTE=HarryG321;45352712]Any recommendations on a backend framework to learn for a personal project? I want to avoid PHP it at all possible. I know a little bit of Python, so I'm tempted to try Django - but are there any other worthwhile alternatives?[/QUOTE] Node.js is pretty rad if you have the time to learn it. Otherwise, Ruby and Sinatra.
OK, this is a long shot, but I've currently got an adaptive layout using CSS column-width. basic gist: [code]<div style="width: 80%; margin: 0 auto 0 auto; column-width: 200px;"> <ul> <li style="display: inline-block">inline blocks so they won't break across columns</li> <li style="display: inline-block">and a shitload more of these, too</li> ... </ul> </div> [/code] All that works. But it's still not right. I would like those columns to be centered, rather than left-aligned. In other words, if there's room for 5 columns but only content for three, fill the middle three. Is this even possible? Or should I give up and redesign this whole page?
[QUOTE=TrinityX;45352103]If you're running nginx it's really easy to incorporate. vhost: [CODE]location /socket.io { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_http_version 1.1; proxy_pass http://localhost:3000/socket.io; }[/CODE] Replace [B][url]http://localhost:3000[/url][/B] with the local address to the node.js daemon (http:// included).[/QUOTE] So I've set up Node.js and everything...am I going to have to rewrite this whole project if I want to use Node.js? Usually I just access stuff through localhost/ProjectName/x/y/z/index.php but now with Node.js it just immediately runs off of localhost:3000.
[QUOTE=WitheredGryphon;45353903]So I've set up Node.js and everything...am I going to have to rewrite this whole project if I want to use Node.js? Usually I just access stuff through localhost/ProjectName/x/y/z/index.php but now with Node.js it just immediately runs off of localhost:3000.[/QUOTE] The nginx snippet he included redirects all requests to /socket.io to your node.js server, meaning you can run socket.io on node.js and PHP at the same time.
[QUOTE=supersnail11;45354227]The nginx snippet he included redirects all requests to /socket.io to your node.js server, meaning you can run socket.io on node.js and PHP at the same time.[/QUOTE] Sorry should've mentioned I'm running WAMP which uses Apache and not nginx. [editline]Edited: [/editline] I can try to switch to WNMP and see if I can make anything happen with that.
[QUOTE=WitheredGryphon;45354320]Sorry should've mentioned I'm running WAMP which uses Apache and not nginx. [editline]Edited: [/editline] I can try to switch to WNMP and see if I can make anything happen with that.[/QUOTE] You can still set it up with Apache, but I don't have any experience with that: [url]http://garrows.com/blog/running-node-js-and-apache-together-using-mod_proxy/[/url]
[QUOTE=supersnail11;45354571]You can still set it up with Apache, but I don't have any experience with that: [url]http://garrows.com/blog/running-node-js-and-apache-together-using-mod_proxy/[/url][/QUOTE] I'll give this a try tomorrow, thanks for the link.
Okay so I'm really used to the PHP-way of creating websites. Basically, create an index.php containing the basic lay-out of the website, being the header, footer, any sidebars, etc. I'm now starting with NodeJS and I'd like to develop websites the same way. I'm really not used to Jade or anything like that. All I know is that it supports routes and it works based on events. If I use app.get("/", function()) it will execute the function() once I go to [url]http://mydomain.com/[/url]. However, I can't seem to find out how to make something work like the PHP-way of developing where you'd simply have a switch statement in the body of the index.php file checking for the $_GET['p'] (unsafe, I know, just as example) and including the said page. Is anyone here willing to help me to understand the "right" structure of an ExpressJS application with my requirements as specified above? I really have a hard time finding what I need and I find loads of examples for "static file servers" using NodeJS but I am 100% certain that there must be a solution. I just can't find the proper tutorials / guides / links to read up on how to achieve what I want.
I don't know how node works but it sounds like it doesn't do it how "PHP does it" (which is [i]any[/i] way, really, you're just accustomed to a certain way which doesn't sound like MVC). Instead of making node work like PHP you should be learning how the node workflow...works.
Sorry, you need to Log In to post a reply to this thread.