Jump to content

proggR

Members
  • Posts

    431
  • Joined

  • Last visited

    Never

Posts posted by proggR

  1. Here is the handout. I didn't have a digital copy of it until now. Look at this mess. Rather than using auto increment she wants us to calculate the ID values in the table. I'm taking it up with the coordinator after the assignment and test. Other people in my class that have used PHP are just as baffled as me. And I feel bad for the students who haven't used it.

     

     

    [attachment deleted by admin]

  2. Create a file like this:

    <html>
    <head>
    <title>My Page</title>
    

     

    And write a simple program to convert it into one your teacher likes:

    echo '<html>';
    echo '<head>';
    echo '<title>MyPage</title>';
    

     

    :)

    Lol I should. I saw one like that for javascript before I had ever used PHP. I was going to use it similar to an include(). Thank god I learned PHP instead.

  3. Speed isn't everything though. Otherwise you picked the wrong language.

    I know that there should be a balance of speed and readability. But just because PHP isn't as fast as Perl or Ruby doesn't mean I can't try to make it as efficient as possible.

    I've had similar experiences. In fact, currently I'm taking a web design course which is horrible. The course is designed as if the web hasn't changed over the past 10 years, and we're being taught horrible practices left and right. I just have to bite the bullet and take the easy A, I suggest you do the same.

    Ya mines the same. I was considering spending some time evaluating all of the courses and mentioning the good things and how to improve the bad as well as mentioning what courses should be dropped and replaced with what and proposing it to the co-ordinator and dean. I mean COBOL on the PC? Really? Why not teach it starting on the mainframe like it should be taught.

  4. Lol good to hear I'm not crazy.

    The rest of the assignment is pretty bad too. At least its something I can knock out in an hour and never have to think about again.

    I considered benchmarking my code vs her code and including the results in a comment along with a lesson on what things she's doing wrong but I don't think she'd like that :P

  5. I'm working on an assignment in a Client Server class right now and the teacher wants us to make an include file. Nothing irregular there. Except what she wants it to contain is code like this:

    <?php 
    function writeHeaders(){
    echo '<html>';
    echo '<head>';
    echo '<title>TITLE</title>';
    echo '</head>'
    echo '<body>';
    }
    ?>
    

     

    .. and so on with another function for footers, a textbox, button and prompt.

     

    Now I could tell right away she isn't the most familiar person with PHP but does anyone ever actually code like this? I can see echoing HTML tags if its a navigation menu or if its for formatting on dynamic content but for that?

    Anyway, let me know. I'm debating between sucking it up and writing some of the most efficient code, as requested, that I've ever written or emailing her and explaining that I will not be writing an include file like this and will make one more sensible.

    Anyway. I'll be interested in hearing some replies :P

  6. I wouldn't say the pattern itself is that unusual, without an x scale it's difficult to say, but I'd imagine the peaks are 'prime time' in whatever country your site is most viewed from and the troughs are in the middle of the night in that time zone. Without knowing more about the type of content on the site it's difficult to say, it's possible your content is being hot-linked or something like that. Having said that, 14.5GB is a large amount of data for 6 days, so whatever it was would have to be on a fairly popular site. You could probably track this down if you have access to the right type of logs, if you don't then your hosting companies staff are the only way to go.

    Its really not a popular site I'm sure. Its just a personal site with some contact information. I plan on adding a portfolio and using it as a platform for small web development jobs. Right now its all static text and nothing special. The X scale was over a week. It does co-relate to day and night but why it would be such a consistent pattern I don't know. It was like this last month but I thought I'd let it wait until the month was up and see if it was just some "new site" kinda thing. I've never used a VPS before so I don't know. Could I somehow be linked to another VPS for traffic? If I am I'm glad I only paid for 6 months.

  7. I've already talked to A2 about this but they haven't really done anything. I'm only 6 days into a new month and its saying I've used 14.5 GB of traffic of my allotted 100. That would translate into about 10000 hits of every piece of content I have available for viewing. So either I need to put ads on my site and fast or something is messed up.

    The traffic graphs look funky too. Almost as if they're sine waves. I'm attaching a picture of the traffic. Maybe someone here has had something similar happen. I'm going to talk to them again tonight but getting responses from the chat was slow before so I'm hoping I can do something on my end.

    Thanks in advance.

     

    [attachment deleted by admin]

  8. I've been thinking about my first computer and the nostalgia is making me want it again. Its pretty bad (a Hewlett-Packard Vectra 386/25N) but it was fun in its time. Does anyone know any places I may be able to find one? I checked eBay and didn't find anything and then Googled it with "buy" after the name but haven't hit any sites actually selling it. If anyone knows that'd be great.

    Thanks in advance.

  9. I like the first two icons (the folder and the magnifying glasses) but the rest seem a littler more rushed.

    Other than that I like it. I'll pass it on to my friend. He'd be interested in having a dyno done and posted I'm sure :)

    Also, I got you an ad click. That bearshare ad at the bottom blends well into your website. I thought you had some kind of audio streaming thing on it haha.

  10. There's not much there yet. I still need to find/add the scripts I made for content management and I need to start some projects for people to build a portfolio but let me know what you think of the look of it. Its really basic and simple looking, which is what I want it to be, but I feel like its TOO basic. Like it should have something more. Also, any font recommendations would be great.

    www.brandonthorn.com

     

  11. 1.  It's probably as easy as using yum or apt-get to install the necessary software.  (yum install php php-cli mysql mysql-client php-mysql httpd for example)

     

    2.  You've configured virtual hosts before, right?  If not, it's still not hard to figure out.

     

     

    You could definitely have it done by Wednesday.  Although, if you're never configured Apache before, or never run anything under linux, then I would say no lol.

    Thanks for the reply :)

    I bought it and set it up already. Its through a2hosting. They had a decent walkthrough for newbs like me :P. Even though it doesn't have cPanel, it does have what I assume is a proprietary management system which made it easier than trying to do it all through the console like I had imagined.

    It also runs Kloxo which I have never heard of but its only taking up 15MB of my RAM so I may leave it with that instead of reimaging it without another distro.

    Anyway, overall good first experience. I'm glad to be rid of shared hosting. :)

  12. I have a placement meeting coming up in two days. I've been working on a site offline to use as a portfolio for the meeting. Its all done, now I just need  a place to host it. I've found a decent price on VPS hosting that I could afford spending money on. I've never used a VPS before though so I'm wondering how much time it will take to get it all setup. With the free shared hosts I've used in the past its been a matter of uploading the site and running some sql code to create the database and its ready. I will not have any kind of cPanel though and I've never really used SSH for anything.

    So here are my questions:

    1 - is this doable by Wednesday? It doesn't have/need PHP or MySQL on Wednesday. I can leave the content static and change it later.

    2 - how hard is it to use one VPS for multiple domains, I have 3 or 4 others scattered between other hosts I'd like to setup on here. None get much/any traffic right now because I haven't done anything with them.

     

    Thanks in advance for any help. I'll keep looking around.

  13. Not sure why you need the id to become available again.

    I assume there is no signing up just allocating ids for the session. Still there will need to be some sort of human readable identifier for those in the chat.

    That's right, there is no signup. Or at least the majority of users wouldn't be signed up. I may offer a signup service to reserve names/ids but that's later.

    And that's correct as well that ids are just for the session. A similar chat site is teenchat. I like a lot of things about their site but I don't like a bunch and there are features missing that I want to add to a chat as well. Its really just for a project to keep busy. Nothing I'd expect to launch publicly I don't think but who knows.

    Basically I'm wondering how to handle session only ids within a database. Should I have it all handled by the PHP scripts maybe and have the primary key be for the user name instead. I suppose that would all the difficulties away. How would be a good way to index it in order for the script to find open ids the fastest. I imagine scanning the database for an open id, especially when it wouldn't be organized by that id, will take a little more processing time than I wanted.

  14. I've had my old phone just sitting in drawers for the past two years. Its still fully functioning and fully capable and if I hadn't graduated to smartphones I'd want this phone (Sony Ericsson w810i). Its a GSM phone with no SIM card in it. I could go get a prepaid SIM for it if need be. Its got a 32MB memory card in it right now but I have a 2GB one around here somewhere. What are some programs I could run on it to add more functionality or hardware/firmware mods I could do to it to have some fun. I'm sure a lot of people have had old phones and either wanted to do something with them or have done something with them. I don't know as much as I'd like about cellphones so I'm not even really sure where to start on it.

    Thanks in advance.

  15. I'm trying to create a simple chat script using AJAX. I've been hacking around with code someone published alongside a tutorial and I've been able to figure out how it works in as far as the tutorial covers and a little bit more. What I want to add now though is automatically assigning an id to each user. The id will auto increment with each added user but in the event that a user logs off, the id becomes available again and the next user to log on will get that id. This way users can interact with each other directly without having to type in long misspelled user names. I'm going to keep searching but so far I haven't had much luck. I'm probably Googling the wrong thing but I thought someone here could get me on track.

    Thanks in advance.

  16. I had already Googled it, hence why at the end I said "I will KEEP searching".

    The descriptions don't make it clear with ones I had looked at whether you would still be prompted or not. I have a program already that bath removes them but you are prompted by each one with "are you sure?" and "restart now or later" and I'm looking for one that will not use MSI in order to bypass these prompts. I was searching for people with experience with a program like that.

    I'd love to install Linux as well but, since these are client computers, that's not an option.

    I had heard of a version of Ubuntu being made recently that looks just like XP and thought it'd be fun to install that but it'd come back fast to bite me. Anyway, I digress.

    Anyone with experience with batch removal software that doesn't use MSI?

  17. I work for a PC Repair company and while doing setups have to uninstall mass amounts of crapware. We currently have software to uninstall it in bulk but it still requires me to hit OK and next and all that jazz like a normal uninstall. I'm wondering if anyone knows if there is a quicker way to uninstall 20+ programs at once just by selecting the ones I want to remove at the beginning of the process and letting the software do the rest.

    If not its obviously not a big deal. I'm just trying to be lazy. I'd need to get supervisor permission on the software but if it works I imagine that'd be no problem.

    Thanks in advance. I'll keep searching myself as well.

  18. Well that's fortunate lol.

    I work a night shift doing pre-setups on laptops for boxing day (blah). If I get there early enough and my supervisor is in I'm going to ask him. I'm hoping he gives me the ok. I hate seeing all my storage, software, screwdrivers, SATA/IDE/USB adapters and knowledge going to waste!

  19. I work for a computer repair service within a large company (I'm sure you could guess what one if you tried). I find a lot of people posting ads on classified websites in need of computer repair. I am very tempted to reply and assist these people for a fraction of the cost of my employer or any competition because I have all the tools and software I'd need for most issues I'm seeing. Do you think this would pose any issues? I can't recall if it mentioned it in my contract. I may ask my supervisor today if I can catch him before he leaves. What if I don't mention to customers where I work? That poses a problem of credibility since I haven't done my A+ yet though.

    $75 for an OS install/data backup is easy money and would be a lot cheaper than the $189 they'd be charged elsewhere.

  20. For number 10 I have:

     

    mysql> SELECT COUNT(*) AS Weekday FROM Reservation WHERE WEEKDAY(ADDDATE(ResvStart,INTERVAL ResvLength DAY)) < 6 UNION SELECT COUNT(*) AS Weekend  FROM Reservation WHERE WEEKDAY(ADDDATE(ResvStart,INTE
    RVAL ResvLength DAY)) = 6
        -> ;
    +---------+
    | Weekday |
    +---------+
    |      12 |
    |       1 |
    +---------+
    2 rows in set (0.01 sec)
    

     

    I don't know why it isn't showing as two columns. maybe union but how else can I do two select statements?

  21. I understand if nobody wants to do my homework but could someone lend a hand with the functions and with the logic of the queries perhaps?

    I'm working on number 9 right now and so far have:

    SELECT CustSurname, CustGivname,COUNT(FKCustID) AS Total FROM Customer, Reservation HAVING Total > 2;

    which returns:

    +-------------+-------------+-------+

    | CustSurname | CustGivname | Total |

    +-------------+-------------+-------+

    | Adams      | Amy        |    91 |

    +-------------+-------------+-------+

    I'm not sure how its getting 91. I'm sure I'm not understanding the Count function.

    Any help would be great. I really have no idea what I'm doing.

×
×
  • 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.