Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. I can't recommend anything specific for Java, but the O'Reilly published books are always very helpful IMO.
  2. @nameless Why not build your framework so that you only install it in one directory structure but then allow client apps that want special functionality to override just pieces of it with their own versions of files. Take this dir structure as an example: ~/public_html/your_framework ~/public_html/site_one ~/public_html/site_two Now you have site_one and site_two both include the same framework for their code. What you do is build your framework so that it optionally takes two arguments when it's included: <?php /** * site_one.php * starting script for site one * This file would be at ~/public_html/site_one/site_one.php */ // Set the path of site one's source code $src_dir = dirname(__FILE__) . "/"; // Set site one's override directory for your framework $override_dir = dirname(__FILE__) . "/override_fw/"; // Include your framework require_once("path/to/your/framework/file.php"); ?> When your framework kicks off, it will look for $src_dir and $override_dir being set, if they're not set then the invoking site has no custom version of your framework. Now let's say site one wishes to override your framework's: <framework_root>/components/layout.php You simply place site one's version of layout.php within: <site_one>/override_fw/components/layout.php You build your framework's loader so that when it includes / requires a file, it checks for existence of the site's overriding copy and loads that if it exists, else it loads the regular framework file. This way updating your framework is easy and multiple sites can work off the same framework installation with customisations.
  3. You're using the term compile incorrectly. PHP doesn't compile anything.
  4. Are you trying to say you want to execute shell commands with a PHP script?
  5. You might want to include a call to exit() after your call to header(), depending on what follows in the page.
  6. pocobuenos idea is one way to go about it, but it's not very efficient in terms of database use. In order to determine which avatars the user has unlocked you would need to select that row, perform PHP code, and then select more information from the database to get the avatar information. If you use the 3-table design that I mentioned, and from your latest post you are correct in how to use it (the 3rd table just links a user ID to an avatar ID), you can do this: SELECT a.* FROM users u, avatars_avail a, avatars_unlckd au WHERE u.id=au.user_id AND a.id=au.avatar_id AND u.id=$user_id ORDER BY a.name That query will extract every avatar available to the user whose id is stored in $user_id. To make the query more efficient as the avatars_unlckd table grows in size, place an index on au.user_id.
  7. That's only 2,000 rows in one table. MySQL is capable of handling tables with literally hundreds of thousands of rows with great speed. Not to mention, what's the difference if you have 2,000 rows of data in one database as compared to another? For what you're wanting to do, sticking with a single database is the best solution. Just organize your tables correctly.
  8. Why not store this information in a second table in the original database? Just create a table for each of the following: users : user information avatars_avail : the 20 available avatars avatars_unlckd : each row connects a user to an avatar they've unlocked
  9. Good advice there. As dumb as this sounds, use OOP when you're creating objects or things that have object-like behavior. For instance, employees, jobs, parts of a framework, etc. are all objects; they are things you can imagine holding in your hand. A library of common functions, such as disk I/O, can be an object, but chances are you don't want to have to create a new object (or use an existing one) every time you want to check if a file exists. These types of utility functions are best organized under a namespace to avoid naming collisions; it just so happens that the only way to do so in PHP is with the class keyword.
  10. This may be the wrong forum; if so, please relocate this post. I'm writing a series of CLI scripts and one of them is generating this error: Failed loading /usr/local/Zend/lib/ZendExtensionManager.so: /usr/local/Zend/lib/ZendExtensionManager.so: failed to map segment from shared object: Cannot allocate memory The script performs the following commands via exec: rm rm cp gzip php <php_script > It's the last of these commands which is causing the error, which is just a call to another of these CLI scripts I've written, which in turn calls another CLI script. The call chain looks like this: [pre] php flash_db.php php run_sql_file.php php create_db.php [/pre] It's the call to create_db.php that causes the error, but only when I call flash_db.php. If I call run_sql_file.php from the CLI, no error is generated. The error appears to be non-fatal since flash_db.php appears to accomplish everything it's supposed to. Does anyone know the cause of this message?
  11. I was guessing "Toilet ISP."
  12. I was just thinking of something like this the other day!
  13. Classic! My fiance is a real penny pincher, I'm gonna show it to her later tonight when she gets home.
  14. Is the modem / router new? When I bought a new cable modem I had to call the cable company so they could activate my cable connection for the MAC address of the modem. Might be the same case with your modem / router combo.
  15. People here are generally helpful, more helpful than most online communities I've had experience with. That said, try and research topics before you post a question to see if you can't find the answer yourself; to that end, google is your best friend. Another useful approach when you can't find any answer yourself is make a general post of what you'd like to do and ask for a list of topics that would give you successful hits on google. A lot of times you can describe what you're trying to do without knowing the details, so it can be hard create a successful search query. The short version of all that is don't expect people to do your work for you and don't come off as that way either; individuals that appear to help themselves will get the most help from any online community.
  16. I photoshopped this image of my cat, thought someone else might get a kick out of it.
  17. That's always been a concern of mine as far as applets are concerned. Thanks everyone for the replies and redbull for the library links. I think I'll do some experimenting with Javascript and see how it turns out.
  18. So it was a guess, I just wanted to make sure you weren't browsing the directory structure. Thanks for the heads up.
  19. Part of my current project involves a UI that I consider fairly complicated to the point that I'm debating writing it as a Java applet vs. using DHTML and Javascript techniques. The content area for this particular page will be a 2-column layout; I think I want the user to be able to resize the columns by dragging a separator between them. Aside from the "normal" input elements (select boxes, radio buttons, etc), the UI calls for a horizontal toolbar, rich text editors, and a tree control for hierarchical data. I know the toolbar and RTEs can be created using Javascript, DHTML, and AJAX, but I'm concerned about the complexity of creating the tree control and resizing the columns. I also plan to implement features that will require data to be sent back and forth between the client and host, such as spell checking, incremental saves, etc. I'm fairly confident this can all be done via Javascript / DHTML, but I'm wondering if Java applets would be a better tool for the job in this case. Without any experience creating applets, it's hard for me to decide. Your opinions?
  20. Just curious, how did you find the phpinfo.php script?
  21. Do you have Firebug for Firefox and the MS Script Editor for IE?
  22. I find generating and editing HTML is more easily done from PHP than from Javascript. I'd suggest hiding small snippets of very common window elements within the page output. Something like: <html> <head><title>Test</title></head> <body> <!-- Empty GUI Elements --> <div id="blank_Icon" class="icon"> <!-- BLANK ICON --> <!-- Whatever HTML is common to all icons --> </div> <div id="blank_Window" class="window"> <!-- BLANK WINDOW --> <!-- Whatever HTML is common to all windows --> </div> <div id="blank_Menu" class="menu"> <!-- BLANK POPUP MENU --> <!-- Whatever HTML is common to all popup windows --> </div> <!-- Rest of page follows --> </body> </html> Now let's say your user clicks on an element that should cause a new window to appear. First you'd request the window's contents via AJAX from the server. In the AJAX callback, you grab the DOM node for the blank_Window, clone it, insert whatever was returned from the server into the duplicated node, insert the duplicated node into the document, position it, and finally display it. As for dragging and resizing windows with persistence, the only data you need to send back to the server is the DOM node's final position (x,y) and size (w,h). In order to achieve this, I'd just the mouseup event for the DOM node to send those values to the server via AJAX. Finally there are some GUI elements that you'll want to display frequently and forcing the user to repeatedly wait for AJAX calls to return could potentially be frustrating. To combat this, you can go about it a few ways: 1) Place all of these elements into a Javascript file included with all pages 2) Use a caching mechanism where you only retrieve the element from the server the first time 3) As the final part of the page load, fetch these elements from the server using AJAX To accomplish #1, I'd probably generate the Javascript file using PHP since, as I previously stated, I find editing HTML is more easily done from within PHP. Another approach would be to use a combination of #2 & #3; keep a record of which GUI elements the user always seems to use and pre-load only those elements. That way you keep the final page size down but still prevent most of the user's wait time. Sounds like an interesting project.
  23. It's hard to tell you which classes from your high school you should be taking without you giving us a list of what's available. As odd as it sounds, I would think something like being on the yearbook staff would come in handy for document design. Another option is to take courses at a junior college while in high school. You need to fill out some extra paper work but then you can sign up for night classes in computer related fields. I did this during my senior year in high school.
  24. I think it's better without the top ads.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.