• Questions That Don't Need Their Own Thread v3
    4,068 replies, posted
  • [QUOTE=antid2;37216134]i was thinking about that..but i've actually only ever used linux..maybe twice, and i'm not too familiar with it..should i just use rubyinstaller or whatever it is? or do you still suggest i go with straight linux?[/QUOTE] RubyInstaller seems like it would be ok (being designed to work on Windows from the start, rather than a compatibility layer)
  • [QUOTE=TheDecryptor;37226372]RubyInstaller seems like it would be ok (being designed to work on Windows from the start, rather than a compatibility layer)[/QUOTE] i figured screw it, might as well do it right..installed ubuntu because i'm not super familiar with linux, got ruby and rails installed, all the required packages as well, seems to run ok :P [img]http://i46.tinypic.com/2ry36vn.png[/img]
  • What would be the best way to create a notifications system? ( I mean from a model stand point ) So far I have a Notifications Model with a type column so I can use STI. I would then create a subclass of it to suit each type of notification. Like: New Reply Friend Request Quoted Only, they all need different data to be displayed. My first thought was that I would for each different notification type create a new model like NewReplyData and link them. But doesn't that defeat the purpose of STI? Even though I only use STI to simplify the query for fetching them all. Someone got some input?
  • yeah, using Single Table Inheritance for that kind of thing makes it kind of pointless. Right now, my permissions are based on the remote type (like "Board" or "Rope"), without using single table inheritance; in my opinion, that makes it more flexible, because you can add another type of permission without having to set up another class. Discerning between "New Reply", "Friend Request", and "Quoted" is not logic the model should handle; that's a part of the view.
  • [QUOTE=Ac!dL3ak;37231519]yeah, using Single Table Inheritance for that kind of thing makes it kind of pointless. Right now, my permissions are based on the remote type (like "Board" or "Rope"), without using single table inheritance; in my opinion, that makes it more flexible, because you can add another type of permission without having to set up another class. Discerning between "New Reply", "Friend Request", and "Quoted" is not logic the model should handle; that's a part of the view.[/QUOTE] And it won't, but they need different kind of data! Things like userid, replyid, threadid but not all the time. Perhaps making like 10 possible data columns would work? It's not as flexible as I normally prefer it but it should work.
  • Okay, I'm dumb. telling PDO to connect to the database via "localhost" takes an eternity, while "127.0.0.1" is instant. lesson learned. [quote]Page generated in 0.0028 seconds.[/quote] Much better.
  • [QUOTE=Crhem van der B;37234360]localhost should work the same as 127,0,0,1...[/QUOTE] I've sat and toggled it between the two, its definitely that causing the issue. [editline]14th August 2012[/editline] Everything on the 127.*.*.* range is loopback. I wonder what its polling to resolve the IP address that takes to long. [editline]14th August 2012[/editline] If it makes any difference, I'm running the site in WAMP. I can't be arsed moving it to my Linux server while I built it and have the drive map crap out constantly while I'm working on it.
  • localhost is loopback too. [editline]15th August 2012[/editline] It doesn't even need to resolve anything as it's defined in your hosts file so there's literally no difference.
  • [QUOTE=Jelly;37239779]localhost is loopback too. [editline]15th August 2012[/editline] It doesn't even need to resolve anything as it's defined in your hosts file so there's literally no difference.[/QUOTE] I do have a huge hosts file for blocking adverts, that may explain it?
  • Has anybody got experience building line graphs? I would like to avoid using a pre-made one unless its VERY simplistic (not all the shitty 3d crap) and fairly easy to use. I basically want to graph an archived record of prices. Some prices can be as low as $1 and some as high as $20,000 so it would need to be fairly dynamic. I also need to track at least 6 different lines at once. If anyone knows a good tutorial for making one that'd be great.
  • [QUOTE=commander204;37228586]What would be the best way to create a notifications system? ( I mean from a model stand point ) So far I have a Notifications Model with a type column so I can use STI. I would then create a subclass of it to suit each type of notification. Like: New Reply Friend Request Quoted Only, they all need different data to be displayed. My first thought was that I would for each different notification type create a new model like NewReplyData and link them. But doesn't that defeat the purpose of STI? Even though I only use STI to simplify the query for fetching them all. Someone got some input?[/QUOTE] I like using STI for this kind of stuff like so: You have a base Notification class in models/notification.rb, then you have specialized classes like Notification::NewReply in models/notification/new_reply.rb, etc. Then for each notification type, you can put a partial in views/notification/_new_reply.html.erb. Then you can do something like this: [code] <% @notifications.each do |notification| %> <%= render partial: notification.class.name.underscore %> <% end %> [/code] although you'd probably want to move that shit into a helper
  • Does anyone have any ideas on how to effectively organise an analytics database table? I'm thinking of just having different columns for the year, month, day, hour and the event that gets incremented every time the event occurs.
  • [QUOTE=Jelly;37246968]Does anyone have any ideas on how to effectively organise an analytics database table? I'm thinking of just having different columns for the year, month, day, hour and the event that gets incremented every time the event occurs.[/QUOTE] Google Analytics offers that out of the box, I don't think it's needed to reinvent the wheel.
  • Hi, 2 questions Is it possible to use a domain on your own local web server? How do you get cpanel-like features on your own web server? Mostly just the subdomain and email account features?
  • [QUOTE=Floatation;37289865]Hi, 2 questions Is it possible to use a domain on your own local web server? How do you get cpanel-like features on your own web server? Mostly just the subdomain and email account features?[/QUOTE] You can edit the DNS information to point a domain to your IP Address, sub domains can be configured in the Apache conf files (assuming you are using Apache) and e-mail uses different server software altogether, although you can host it this is something im not familiar with. Honestly I would recommend just paying for some hosting, its much easier and doesn't put strain on your bandwidth, not to mention the cost of running your PC constantly for an e-mail server.
  • [URL="http://z0w0.me/labs/atomica"]My work in progress HTML5 game[/URL] is lagging like hell with GPU acceleration enabled on Windows (with any browser). However, it's working fine for me with Chromium 21 on Linux and anyone that had absolutely halted performance with GPU acceleration had it running fine at 60fps with acceleration disabled. Does anyone have any idea what could be causing this? Notes: I clip the canvas to stop any drawing outside of the viewport, objects use gradients and circles which are laggy to path each time so each object has its own canvas that is compiled once and I use requestAnimationFrame. This is as far as I can think to optimize it without making the game only render the portion of the canvas that has changed each frame. WARNING: It may potentially slow down your system. EDIT: Forgot to mention that it runs Box2D in the rendering process, but that's not important - one person who was lagging horribly managed to profile it and found Box2D was using hardly any of the total CPU usage (the Chrome profiler stated that Chrome itself was using ~98% of the CPU, which is very strange and unreproducible on my side). EDIT: Seems to be fixed now. Looks like the ctx.clip calls were doing it.
  • [QUOTE=z0w0;37294863][URL="http://z0w0.me/labs/atomica"]My work in progress HTML5 game[/URL] is lagging like hell with GPU acceleration enabled on Windows (with any browser). However, it's working fine for me with Chromium 21 on Linux and anyone that had absolutely halted performance with GPU acceleration had it running fine at 60fps with acceleration disabled. Does anyone have any idea what could be causing this? Notes: I clip the canvas to stop any drawing outside of the viewport, objects use gradients and circles which are laggy to path each time so each object has its own canvas that is compiled once and I use requestAnimationFrame. This is as far as I can think to optimize it without making the game only render the portion of the canvas that has changed each frame.[/QUOTE] this is my computer [img]https://dl.dropbox.com/u/11275736/s/d/f/o/specs.png[/img] you managed to slow it to a fucking crawl
  • [QUOTE=Ac!dL3ak;37295206]this is my computer you managed to slow it to a fucking crawl[/QUOTE] Yep, and I have absolutely no idea why. It is working fine for me with both GPU acceleration enabled and disabled on Linux. Some Windows users can run it fine as well. EDIT: If you can, try disabling GPU acceleration (simple as going to about:flags in Chrome, probably just as easy in Firefox).
  • Doing a group assignment for school, I have to make a login page for a market day bank system with a teacher part and a student part. How it works is that I have a username and password text box, a radio option thing to go to the teacher section or the student section, I don't have any php yet but I'm working on the html. What I want to know is if I can have 2 buttons, 1 labelled teacher and the other student, and it takes them to that respective page if the username and password they typed in has the right privileges. I'd also like to encrypt the passwords so I googled it and everyone says "use bcrypt", when I google how i get nothing remotely helpful. Does anyone have a link/willing to type up how i implement it?
  • Are there any PHP frameworks you guys can recommend? It's for a personal website so I don't need a whole lot of features, but it'd be nice to have some kind of structure I can code my website around. [editline]19th August 2012[/editline] Seems Codeigniter is recommended a lot as a simple lightweight framework.
  • You don't really need a framework for a simple personal website, but whatever. Beside CodeIgniter there is CakePHP which is also very popular.
  • [QUOTE=Clavus;37313551]Are there any PHP frameworks you guys can recommend? It's for a personal website so I don't need a whole lot of features, but it'd be nice to have some kind of structure I can code my website around. [editline]19th August 2012[/editline] Seems Codeigniter is recommended a lot as a simple lightweight framework.[/QUOTE] [url]http://laravel.com/[/url]
  • Anyone has any information on search engine friendly URLs that are also user friendly? If each page in my site has a name that is not guaranteed to be unique, how do I encode it so that it becomes unique without sacrificing readability?
  • <?php //By McGii $pass = $_POST["Password"]; $i = 0; echo $pass[$i]; while ($i <= (strlen($pass)-1) $result mysql_query("SELECT Encrypted FROM encryption WHERE Normal = '" . $pass[$i] . "'"); Why won't the above parse? Apparently there's an unexpected variable in the last line
  • I had it pasted into the post box when i said that but i fixed it then forgot to change the code here but posted anyway cause it still wasnt working Turns out I was missing a ) as well