• Web Development - WAYWO - #8
    5,514 replies, posted
okay, I'll see what I can get out of the source code and I'll decide whether or not I want to alter that part. good work
Don't have any pics but I moved to Lithiumhosting overload plan at last, and currently revamping my entire blog.
More progress on my DVD Rental Site for university, [url]http://greenfilm.spero78.com/[/url] [img_thumb]http://puu.sh/4J3WX.png[/img_thumb] [img_thumb]http://puu.sh/4J40J.png[/img_thumb] (Retina resolution, sorry) Built using Laravel 4 and Bootstrap 3 :) All the films are added to my database using themoviedb.org API, try viewing a film and clicking on genres. some features aren't implemented yet, but any feedback is appreciated on all parts of the site
Never mind.
Looking for a bit of input on an idea I had. I need to setup some sort of service or something that I can use to queue SQL queries so that if they can't be done straight away, they'll be done eventually. My question is - how the hell do I go about it? Should I create something in PHP along with my project that acts as a query queue and checks the queue every second to check if there is a new query or something? Or should I create something external in node.js that I can make requests to with the query content?
I'd create a queue using something like redis as the backend. When a query is added, push it to the end of the queue, and then have a worker running that checks for items on the queue, pops the off the queue when there is something there, and then checks the queue again when it's done with the current job. Just out of curiosity, why do you want to do this though? Background queues are awesome, but I don't know that it's a good idea to do with SQL queries. What happens if you make a change to your DB schema when there are a bunch of jobs in the queue still? What happens when a query fails?
[QUOTE=KmartSqrl;42445535]I'd create a queue using something like redis as the backend. When a query is added, push it to the end of the queue, and then have a worker running that checks for items on the queue, pops the off the queue when there is something there, and then checks the queue again when it's done with the current job. Just out of curiosity, why do you want to do this though? Background queues are awesome, but I don't know that it's a good idea to do with SQL queries. What happens if you make a change to your DB schema when there are a bunch of jobs in the queue still? What happens when a query fails?[/QUOTE] I'll look into Redis and see what I can do. The main reason for it is that if the database goes down for half an hour, the queries that were created during that half an hour aren't lost, when a query fails I guess the worker would move onto the next one in the queue and try that - that way if there's any bad queries, they won't clog up the queue.
[QUOTE=Dorkslayz;42445726]I'll look into Redis and see what I can do. The main reason for it is that if the database goes down for half an hour, the queries that were created during that half an hour aren't lost, when a query fails I guess the worker would move onto the next one in the queue and try that - that way if there's any bad queries, they won't clog up the queue.[/QUOTE] Are you actually experiencing downtimes like that with your database? I would say you should fix that issue at the source instead of trying to work around it. Your DB shouldn't be going down for 30+ mins at a time. If you're not experiencing those downtimes then I don't think you need to build this queue system, because SQL databases tend to be pretty reliable and you'd be adding an unnecessary layer of complexity to your app. If you absolutely can't solve the issue at the DB level, then I would make sure that you aren't putting plain queries in the queue, but are instead putting only the data that you need in the queue and then building your queries when it's actually time to run them. That way you shouldn't even end up with queries in the queue that are meant to be run against an old version of the database if you make schema changes.
[QUOTE=KmartSqrl;42445762]Are you actually experiencing downtimes like that with your database? I would say you should fix that issue at the source instead of trying to work around it. Your DB shouldn't be going down for 30+ mins at a time. If you're not experiencing those downtimes then I don't think you need to build this queue system, because SQL databases tend to be pretty reliable and you'd be adding an unnecessary layer of complexity to your app. If you absolutely can't solve the issue at the DB level, then I would make sure that you aren't putting plain queries in the queue, but are instead putting only the data that you need in the queue and then building your queries when it's actually time to run them. That way you shouldn't even end up with queries in the queue that are meant to be run against an old version of the database if you make schema changes.[/QUOTE] Oh no, I'm not experiencing downtimes like that - It's just thinking about every possible eventuality.
[QUOTE=Dorkslayz;42445786]Oh no, I'm not experiencing downtimes like that - It's just thinking about every possible eventuality.[/QUOTE] I definitely wouldn't worry about it for now then. If your DB is going down for 30 mins at a time often enough to need a solution like this, there are better ways to solve it. Doing things like master/slave replication and automatic failover when the master goes down is a lot better way to fix this.
[QUOTE=Spero78;42430528]More progress on my DVD Rental Site for university, [url]http://greenfilm.spero78.com/[/url] [img_thumb]http://puu.sh/4J3WX.png[/img_thumb] [img_thumb]http://puu.sh/4J40J.png[/img_thumb] (Retina resolution, sorry) Built using Laravel 4 and Bootstrap 3 :) All the films are added to my database using themoviedb.org API, try viewing a film and clicking on genres. some features aren't implemented yet, but any feedback is appreciated on all parts of the site[/QUOTE] This is seriously one of the most gorgeous things I've seen in a while.
[QUOTE=Spero78;42430528]More progress on my DVD Rental Site for university, [url]http://greenfilm.spero78.com/[/url] [img_thumb]http://puu.sh/4J3WX.png[/img_thumb] [img_thumb]http://puu.sh/4J40J.png[/img_thumb] (Retina resolution, sorry) Built using Laravel 4 and Bootstrap 3 :) All the films are added to my database using themoviedb.org API, try viewing a film and clicking on genres. some features aren't implemented yet, but any feedback is appreciated on all parts of the site[/QUOTE] Are you renting out physical copies, or streaming? I realize it says DVD rental, just curious.
[QUOTE=FrankPetrov;42459191]Are you renting out physical copies, or streaming? I realize it says DVD rental, just curious.[/QUOTE] Its just a project hes doing, it doesn't mean he's actually gonna stream/rent. It's just practice or some sort of assignment from his University. [editline]9th October 2013[/editline] [QUOTE=Spero78;42430528]More progress on my DVD Rental Site for university, [url]http://greenfilm.spero78.com/[/url] [img_thumb]http://puu.sh/4J3WX.png[/img_thumb] [img_thumb]http://puu.sh/4J40J.png[/img_thumb] (Retina resolution, sorry) Built using Laravel 4 and Bootstrap 3 :) All the films are added to my database using themoviedb.org API, try viewing a film and clicking on genres. some features aren't implemented yet, but any feedback is appreciated on all parts of the site[/QUOTE] By the way your search doesn't work by pressing enter, I tried searching for "Life of Pi" and it only came up when I pressed the actual search icon.
[img_thumb]http://puu.sh/4LVtc.jpg[/img_thumb] lol columns and grids and shit
Super cobbled together admin-only portion of a freelance project I'm working on. [IMG]http://i.imgur.com/ks60eZS.png[/IMG] [editline]9th October 2013[/editline] Here's a little quick tip some of you might find useful. Add this to your .bashrc/.zshrc (I use zsh, so I haven't tested in bash) [code] function sublp (){ subl --project "${PWD##*/}.sublime-project" } [/code] This will open sublime text using a .sublime-project file that has the same name as the current directory. So if I have a spoon directory with a spoon.sublime-project in it, it will open sublime text with that project file when I type sublp in the command line instead of having to type "subl --project <project name>.sublime-project", which sucks. I use sublime projects to make sure that tmp folders aren't loaded in sublime (makes sublime run a little faster because there's less stuff sublime is keeping an eye on, better find all in project speed and all that too)
[QUOTE=Moofy;42463110]Its just a project hes doing, it doesn't mean he's actually gonna stream/rent. It's just practice or some sort of assignment from his University. [editline]9th October 2013[/editline] By the way your search doesn't work by pressing enter, I tried searching for "Life of Pi" and it only came up when I pressed the actual search icon.[/QUOTE] Yeah the search isn't complete yet because of how html forms handle the get method, and its not functional, if I had a warehouse full of dvd's I could theoretically use this to rent them out, but I don't. I might try and sell it once its finished or open source it.
is it a natural thing to buy a mac when you start developing nice websites? i see every most of the skilled people posting from mac doesn't that have issues when developing for the broad audience of windows users? or do browsers act the same on each platform? (prospective mac web developer)
Hi guys, long time no see. I am back in business, baby.
[QUOTE=Kwaq;42475215]is it a natural thing to buy a mac when you start developing nice websites? i see every most of the skilled people posting from mac doesn't that have issues when developing for the broad audience of windows users? or do browsers act the same on each platform? (prospective mac web developer)[/QUOTE] I use Linux myself and I don't really see a big problem with it. Browsers should generally work the same on each platform. But you might want to have a windows virtual box running with IE8,9,10 or whatever you please, you can even install any browser as well if you'd like if you want to be really really sure if it all would work under windows as well. But in my experience I haven't really seen any difference on different platforms so it shouldn't be a really big problem but I do recommend checking (when you're done, or almost) them all just to be on the safeside. Obviously you should still check different browsers no matter what OS you're running.
Added in Recaptcha so if a site comes under attack or an influx of bots come you can just add: [CODE] self.use("recaptcha"); [/CODE] To a validator and it's automatically inserted into the generated markup and checked when validating the form.
Anyone got experience with magento ? I am trying to add more tabs for a product, like, description, specification, accessories and warranty. How do I go about that ?
[QUOTE=Kwaq;42475215]is it a natural thing to buy a mac when you start developing nice websites? i see every most of the skilled people posting from mac doesn't that have issues when developing for the broad audience of windows users? or do browsers act the same on each platform? (prospective mac web developer)[/QUOTE] Only major difference between both is the nice font rendering on OSX. Windows does an awful job.
[QUOTE=Jeller;42477051]Only major difference between both is the nice font rendering on OSX. Windows does an awful job.[/QUOTE] yeah i used my friends retina once making something and it made my sublime text look so pretty so i wanted to get one :v:
[QUOTE=Jeller;42477051]Only major difference between both is the nice font rendering on OSX. Windows does an awful job.[/QUOTE] That's one of the least significant reasons to go with OSX. The fact that it's unix based makes a a lot of dev stuff a whole lot more enjoyable.
Need to figure out what to do with the content... No ideas. [t]http://i.imgur.com/nPRCa10.jpg[/t] [URL]http://hmiljak.com/projects/Tron/[/URL]
[QUOTE=Kwaq;42475215]is it a natural thing to buy a mac when you start developing nice websites? i see every most of the skilled people posting from mac doesn't that have issues when developing for the broad audience of windows users? or do browsers act the same on each platform? (prospective mac web developer)[/QUOTE] I had worked on Windows for years, switched to a mac simply because I wanted a reliable, high performance laptop for university. After using it for a year I have switched my whole workflow over to OSX, it plays so nice with linux servers, Switching back to windows feels like going back in time. Havent turned my PC on for weeks. There is no reason you cannot make brilliant websites on windows though.
[QUOTE=KmartSqrl;42477231]That's one of the least significant reasons to go with OSX. The fact that it's unix based makes a a lot of dev stuff a whole lot more enjoyable.[/QUOTE] I was referring to the differences in browsers on different platforms.
[QUOTE=Jeller;42480036]I was referring to the differences in browsers on different platforms.[/QUOTE] That would make more sense :v:
Earlier today I launched this: [url]http://fno.themadhacker.co.uk/[/url] It was a very simple project I built for a friend (in a super short time, didn't have time to implement all the functionality I wanted to) which essentially uses the twitter search API and caches results. It's cached over 5000 tweets and had just over 1000 uniques since around 10AM... I was not ready for this. I wanted it to pull in data from Flickr and Instagram too but ran out of time, what does everyone think?
You should consider infinite scrolling pagination for that.
Sorry, you need to Log In to post a reply to this thread.