atomiku
Members
-
Joined
-
Last visited
Reputation Activity
-
atomiku reacted to djitsz in Coding a Facebook Wall / Feed type script. A question of best methods, efficiency and scaling.Creating feed tables for each user would be very bad as you are duplicating a lot of content in your database (i.e., if one user adds a new post this would need to be written to the feeds of each user who should see this post).
You would also not query all the tables together in one query unless these tables represent entities which are linked (such as a Post and a User). Joining tables which are not linked in this way creates a Cartesian product of all these tables (i.e., combining all elements from one table with all elements from another table) which leads to huge results with lots of duplicate content.
You would need to write separate queries for each type of content to be included in the feed, i.e., "SELECT * from `articles` where `articles`.`category` in (
);", "SELECT * from `posts` where `post`.`userID` in ();" etc.
You then use whatever scripting language you use to present the results from these different queries in whatever way you see fit.
-
atomiku reacted to Chris Day in I have 6 inline-block fixed width divs, but the container is fluid. How can I split the inline-blocks evenly based on width?If the boxes are not a pre defined width yes you will have to use JQuery but even then if they are all different widths it will be very hard to get them to align
if you did know the widths you could use
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>Untitled Document</title> <style> .hiddenNewLine { display:none; } @media screen and (max-width: 660px) { .hiddenNewLine.half { display: block; height:4px; } .hiddenNewLine.third { display: none; } } @media screen and (max-width: 335px) { .hiddenNewLine.third { display: block; height:4px; } .hiddenNewLine.half { display: none; } } </style> </head> <body> <div class="container" style="width:100%;"> <div style="display:inline-block;width:100px;height:100px;border:2px red solid;">One</div> <div style="display:inline-block;width:100px;height:100px;border:2px red solid;">Two</div> <div class="hiddenNewLine third"></div> <div style="display:inline-block;width:100px;height:100px;border:2px red solid;">Three</div> <div class="hiddenNewLine half"></div> <div style="display:inline-block;width:100px;height:100px;border:2px red solid;">Four</div> <div class="hiddenNewLine third"></div> <div style="display:inline-block;width:100px;height:100px;border:2px red solid;">Five</div> <div style="display:inline-block;width:100px;height:100px;border:2px red solid;">Six</div> </div> </body> </html> -
atomiku reacted to Chris Day in Maths problem! I have a range of -1000 to 0. When percent is 100 I need value of 0, when percent is 0 I need value of -1000im guessing you are using javascript if so this will do, to convert it to another language shouldn't be too hard
function rangePerc(min, max, perc) {
var diff = max - min;
return max - ((diff/100)*perc)
} -
atomiku got a reaction from Akshita Sharma in Change in URL StructureJack, it's possible you could do something like /latest-news/ to /news/2013/... but I might need an example of your URLs.
/latest-news/news-post-title/
/latest-news/first-post-hello-world/
If you wanted to forward those to /news/2013/post-title/ instead, you could use the following rewrite rule:
RewriteEngine On RewriteRule ^latest-news/(.*)(/|)$ http://foo.com/news/2013/$1/ [R=301,L,NC] Now, the (/|) after the (.*) will optionally match a trailing slash at the end. http://foo.com/latest-news/post-title would now redirect to http://foo.com/news/2013/post-title/ --- This is assuming all your new post URLs are to have 2013 in them, and not 2012 or 2011!
If this won't work for you, there is the option of forwarding latest-news/(.*)/ to a PHP script, which would look up the post and then redirect to the correct URL via a 301 redirect. Below is a quick example:
RewriteEngine On RewriteRule ^latest-news/(.*)(/|)$ http://foo.com/redirect.php?post=$1 [R=301,L,NC] ~atomiku
-
atomiku reacted to BlueDreamer in A separate copy of the site for each office, duplicate content, question about canonical tagsThat sounds like a very "organisation-centric" approach, rather than what's best for the customer, no wonder you have a dilemma!
My advice would be to tell your client that their approach isn't the right way to go. Instead you only need to list your services once then provide contact info for each office separately. If needs be you could related services to offices from the service data, eg "This service is available from offices in: London and Scotland", or on the office data page reverse related service data, eg "Our London office provides these services: Service a, Service b"
Yes, use of canonical may work but think of the porr customer who could easily get confused with all thsoe duplicate pages!