Jump to content

sircatsquid

Members
  • Posts

    24
  • Joined

  • Last visited

Posts posted by sircatsquid

  1. It sounds like a Pear exception is going to an error log. Pretty hard to figure out what the error is if you don't have access to that though. You can try changing the error log to a file that you have access to with the error_log option.
    Have access to PEAR since I installed it with the go-pear file. I just don't have access to php and apache. Can't see that PEAR has a error file :/
  2. Okay, so I moved my files to the host and Installed PEAR and the component I needed to make smtp mail's, problem is that as soon as NET_SMTP is installed I no longer get errors for missing things or code errors, When I run the script that uses PEAR the server stops responding on every page, FTP works fine. I can't check for error logs since it's on a host and I only have access to my www folder. What to do, anyone know's what could be the issue?

  3. I know that you aren't suppose to have duplicate data in the database but I need to have this data as backup in these tables in case the foreign data gets removed.Like all the users in one table and lets say blog posts in an other if the user gets removed I still want the username stored in the blog table. While writing this I just realized that I might not ever remove any data just flag it out and update the sensitive columns to blank. But still going to ask is there a way to link column data to be updated between two tables like the foreign key updates if the foreign data change id. My educated guess is that this is something solved on the server side and not in SQL.

  4. First Quote is you saying you don't want to program because you want money.Second comment is saying you are doing programming just for the money, and would rather do the transportation business.Third Quote is you assuming you know more about how "fun" programming is. I work with it, it is my full time job, it is just as fun to work with it when you have a goal to work towards. Some times more fun because you know what you are trying to make.
    Here is where you read things a bit fast. "don't want to program because you want money." is not what it says. See the difference?"I don't do programming cause I want to make money." This is what it says."don't want to program because you want money." This is what you probably read So let me rewrite it and see if you understand the sentience in a different way.So what I'm saying is, money is not why I am doing programming. Second quote isn't stating anything about wanting any money at all but the opposite.Third quote is not stating that I know how funny it is but that it is not boring to do it.
  5. You are being very contradictory right now... You said before you don't want to program because you want money.Now you are saying you want to program because you like it? I am really confused what your problem is... Just find what you like and do it.
    Haven't said I want money. I haven't said that I don't enjoy programming. I just don't have the focus on it right now. Now again I'm telling you working with it is not the same as just playing around.
  6. A must? I don't understand...Programming is a language.It is a puzzle that has several different solutions, but, several different "busts".Programming is not an easy road to go down. So if you want a job with it you have to understand that and accept it.But I still don't understand what you meant when you said you want to make money... You can make good money programming.
    Yes but compared to your free time programming sessions you don't have a deadline and there isn't much of a consequence if you take a 2 week break from the problem. About what I wrote about the money is that I haven't learned all this cause I want to make lots of money which many beginners has as a goal. I learned this cause I was curious. I actually wanted to work in the transporting business and still do think it's something for me. But now my source of income is from my programming skills. That you can make lots of money is probably true but I don't aim for it. My aim is that stimulates my interest I wouldn't bother with a job what makes me tons of money if it is something that waste my time.
  7. I guess I don't understand this as a reasoning...You said you enjoy programming, so why not pursue it as a job?If you love what you do, you don't work a day in your life. Also, Computer Science majors (programmers) make on average close to six figures... that's a lot. But I do agree, try to step away from the computer in stressful moments. Go for a walk, jog, or just enjoy the fresh air. Ideas will come faster that way then stressing over an LCD screen.
    You have more of a must when you work with it, witch kills some of the fun in programming.
  8. You'll end up with the values ORd together in a bitwise fashion. Assume you have the numbers ten and 2, which are expressed in binary: 2 = 10ten = 1010 doing 2 | 10 will be a bitwise OR, and you will end up with : 00101010____1010 So the value will still be ten. The result of a bitwise OR means that any bit that is 1 in either operand will be set to 1 in the result. A bitwise AND (&) means that both bits in the operands need to be set to 1 in order for the result bit to be 1. A bitwise XOR means that only one or the other, but not both, bits need to be set to 1. This is bitwise arithmetic, you can research that for more information.
    Okay, thanks I will look into that :)
  9. For me, it's sleep. I have found that whenever I'm not able to focus, or "not in the mood" to write etc, I realize it's simply because I didn't get adequate amount of sleep the night prior. When trying to write when you barely slept, it can be difficult because you're not as focused and simple things like syntax for example can become mistakes. Critical thinking to solve a programming problem goes out the window for me with no sleep as well. Another thing for me is the environment; it can take me out of focus if it's too noisy/loud, uncomfortable, etc. I need a nice, quiet, comfortable environment. For instance, I currently bought an iMac because of how quiet it is(one of the many reasons). Before I had a powerful windows machine with a lot of case fans that made the machine very noisy resulting in my focus being hindered sometimes. Other times it's just not "feeling" the motivation because sometimes the "task" is not motivating for me enough. For example: when I made the page on my site that deals with resizing images, I wasn't too motivated at first because what came first to mind was a simple page that resizes a users' image. I wasn't "feeling" that for some reason, but then I thought to myself how can I make it more interesting(for me that means challenging)? Then from that an idea came where I would give the user the option to resize many pictures at once. I thought to myself "hmm not bad, would be interesting and a challenge to yourself" which resulted in me being motivated. So then I started to work on it, but then I thought, what if a user selects a wrong file type in that batch of images to be resized... should I stop the process immediately? I thought to myself, no... instead allow the images with the correct files types to be uploaded and resized and the incorrect ones to NOT be uploaded/resized but allowing the resize process for the correct file types to continue and after the process is over, display the resized images for the user and then also display the "errors" they made during the resize process as well. Another one that may take some out of focus is simply... "thinking" programming is what you really want to do but deep down, it is not. But some still try to do it because of well.. "thinking" its what they want to do(in life) and A LOT force themselves to do it(for various reasons, one is: $). This is not really good imo because it would be like swimming against the tide every time or trying to swim up river when the river is flowing down river resulting in little or not results really. I'm not saying this is you, I'm just stating. :) Well, hopefully you'll find your groove back soon. :)
    Sleeping, might be something worth trying. Though I do get all the hours I need, I get them at the wrong hours of the day. I don't do programming cause I want to make money. I didn't want to have it as a profession to begin with, but now I found my self doing it anyway and I even like it. But compared with having fun playing around I actually have a deadline and things that has to be done, so that is a bit of a stress factor. I've tried taking walks and they do work, I get new ideas during the walk but usually it's blank when I get back in. Should have some notepad with me maybe?
  10. I'm in a bit of a ruff point in my life and I haven't been able to get the focus I need on work. I get an hour done every now and then but never that total focus when the hours flyby. I'm soon done with a larger project that will be used in my next one. I'm guessing this also makes things go a bit slow. What do you guys do to get your focus on programming? Any hint on what I can do?

  11. The | is an operator tha does a logical OR operation with each of the bits of the two arguments. I don't see why somebody would need to do that in the is_int() function because both should be integers to begin with if you want to do bit operations. You only do this with function arguments when the arguments are flags (their binary representation is all zeroes except for one bit). Using the | operator can add several flags together so that the function gets the information of multiple flags with just one argument.
    Okay, then I know. :) I just used is_int cause it was shorter to write, But I was thinking if I could send multiple arguments to one function argument.
  12. It will only report the line where it detected an error. Maybe the cause is somewhere else, but it reports the point at which it determined that there is a problem.
    Yeah I know, this just felt so far of. Should really make a automated testing script on all methods. Instead of manually test everything. I should really learn how to use a TDD library.
  13. That looks fine to me.
    I did find the problem but oddly I got the error at that place, cause the error was couple of hundred lines away :/ Had to use exit to find the location of the error, moving one line at the time till the error occurred again. But it's odd that the compiler can't tell where it was :S
  14. Is it possible that php says the error is in the wrong line.It's now saying that my object isn't an object. But if I var_dump, It says it's an object.

    Fatal error: Call to a member function getID() on a non-object in /var/www/lib/UserTypeHandle.php on line 84
    $lang = ($type->getLanguage()) ? $type->getLanguage() : self::$ref->URL()->getLang();$langID = $lang->getID(); //Line: 84, this becomes an error untill I do exit on the next line then everything is OK.

    This is the var_dump of $lang:

    object(Language)#22 (5) { ["name":"Language":private]=> string(2) "en" ["lastUpdated":"Language":private]=> string(19) "0000-00-00 00:00:00" ["createDate":"Language":private]=> string(19) "2013-04-10 16:30:28" ["id":"Language":private]=> int(1) ["dataHandleFlag":"DataHolder":private]=> int(1) }

    Very confused.

  15. you can use static::YEY which resolves to current calling class.
    Yeah, but that didn't work either... why? Well the issue was that I forgot to refer to what class the constant was belonging to when assigning the default value of a privet property in the parent class.Funny cause it said the error was on the line there I was instantiating the child class... very confusing. Thanks anyway for sharing your thoughts, it's appreciated to get some hints.
  16. Um.. tried Google this but I only find answers about if making constant abstract...I just wonder if I can have constants in an abstract class. Cause I get this error of a undefined constant. This just a example of what I mean and not the actual code, does the same on the other hand.

    abstract class testconst {    const YEY = 0;    public function dosomething(){	    if(testconst::YEY == 0)		    return "Awesome!";    }}class test extends testconst {    public function something(){	    return parent::dosomething();    }}

    What I was aiming for to have a base class that did some general thing I don't want to define in every class and I wanted to define some options for it.

  17. So I never seen anyone use copy to move the uploaded file to it's destination,if you followed any tutorial they would have used this function, very curious did youactually upload anything with copy to the destination?http://www.php.net/m...loaded-file.php Also you need to escape your user submitted data before having it in the query.http://www.php.net/m...cape-string.php You should look at mysqli since mysql is deprecated and will disaper from the near future.http://www.php.net/mysqli

  18. One way is to make a static class which has all of your properties. You won't need to pass it around or specify as global or anything, it will always be available in any scope.
    Yeah I did that at first but it didn't feel right also it's considered bad practice to use static like that. But yes one way of doing it.
  19. I've already got a solution for this but might get something I haven't thought of.I'm starting to have a lot of reference variables to send to each class what is the best practice here?I solved this with a resource class, that I send instead with all the references I need to send. Any other suggestions on this problem is appreciated. But I think this will work just fine, just curious if there is other ways.

×
×
  • Create New...