Last visited

Days Won

Forums

Everything posted by Antonio Conte

Regarding this whole thing... I think this issue is seriously overblown in the media. What matters is what consequence any login details someone picked up would have for you. If someone found my Gmail credentials, I would be in serious trouble. Loosing access to something like my IKEA wishlist would however not affect me in the slightest. Two-factor auth is something anything with critical information should have.

How do you want to save JobSkils? You might want to rethink your database design a bit, as your users seems to be able to select multiple skills at the moment. While saving all skills in a single field is possible, it'll leave you a lot more job in the end. Things like searching users for specific jobSkills might be very performance heavy. It will also be very hard to debug should anything go wrong.
That said and done, what is the function PagePost doing? You are sending it an array now, and that might be your problem. Unless the function breaks it down into comma-separated values, or you save it as JSON (or similar) you should get no values saved to the db. You need to work with that array somehow. (And it's not shown if you do here, so I assume that's the problem)
Given the above, I would create another table just for job skills. You then assign each skill selected by the users into a multi-value insert query and insert it after you create the user.
Is that enough info and does it answer your question? Good luck.

I really recommend you to do some command line training. A Mac is just another Unix box in the end, and you should treat it like one. I would recommend you looking up Homebrew for installing PHP, as it makes it a lot easier to add new extensions to PHP.

Any of you read the book yet? I would recommend it, even if you are not a Steve Jobs or Apple fan. It's a great biography of a very interesting man with a lot of passion and great stories. I found it really hard to put it down, resulting in a few sleep-less nights — a great sign for any book.
I'm really curios to see how Apple will do without Jobs, as they currently beat every single laptop rival by a long shot. I've never touched a laptop without flaws, in comparison, since I bought my first Apple machine three years ago, and I think I'll end up buying my third later this year.

If the file doesn't exists, you might have to create it first. Try running the following to create it:
touch ~/.bashrc
or just cd into the location to make sure the file's there.
cd ~
ls -laG
If that command still doesn't work, textmate isn't available as a command. You can try nano or just find the file in finder and open it however you like.

My trick for permission problems (needing to be root user) is prefacing commands with sudo and entering my password. Is there a better way I don't know about?
The reason why I like seeing hidden files is it makes the two-step folder-by-folder navigation I talked about in my first post a lot easier. There's no need to be a command line ninja if you can learn the folder structure an easier way.

I think that command was changed between some of the OSX updates. Try searching google for "view hidden files OSX {YOUR-VERSION}". It shouldn't be hard to find. Dump the thread if you need any more help.

Your if-statements probably needs brackets. Hard to determine by watching code on this forum, but you need brackets unless your following commands are single-line. The echo statement makes them span more.
I suggest an IDE like Netbeans to automaticly catch these errors, btw.

Those folders are hidden on your computer. To be able to see them, you need to run the following commands:
defaults write com.apple.finder AppleShowAllFiles -boolean true
killall Finder
If you want to hide them again (you shouldn't need to) run these commands:
defaults delete com.apple.finder AppleShowAllFiles
killall Finder
When that is done, you should be able to find them both using Finder and the command line. The easiest way to move using the command line is to do it small steps. Use "cd .." to go back a directory, "ls -laG" to show it's content and "cd {DIRECTORY}" to go into a folder. This is much simpler than writing the fulls paths until you get used to it.
Next, you want to do something called simlinking or moving the binaries to execute them without the directory path. The easiest way to do this, in my opinion, is to create a .bashrc file. This file should be placed in your user directory to influence your user. Use this command (or open it using finder - this is a hidden file, so do step one first) to open the file in textmate:
textmate ~/.bashrc
In that file, you can create several aliases for convenience. With the following lines, you should be able to use mysql and mysqliadmin without the full path to it. You can do the same with PHP, Sublime or anything else you want.
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
# Add your own here. Google for more info
Hope that helps you out. The command line is pretty easy, but you need to be familiar with the basics. You can also use the .bashrc file to enable colors, etc.
PS: Keep in mind you need to close and reopen the command line for changes in .bashrc to take effect.
PPS: I'm not on my MAC now, so I haven't tested any of this. Ask if you have any questions or google if you get any error messages.

I really like learning by attacking specific problems. When I've gotten it to work, I reorganize/rewrite code, comment it thoroughly and try to simplify it as much as possible. When the code "feels right" and your happy about it, you move on. In the beginning, these problems where really simple. How do I insert anything to a DB? How do I load that data, place it in forms, and update any changes? How do I upload images? The key to anything you learn is to break it down into manageable parts.
As for design patterns, object-oriented programming or frameworks, all of those are organizational tools, work-kits or best practices, and little more. There are tons of things to learn in the programming world, but very little of that is strictly necessary in every application. Most of these things are rooted in economics as productivity of workers and maintainability of code can be larger costs than the actual development in itself. Fixing a bug on popular code three years down the line can be a huge expense. Adding small features to crappy code written five years ago might be double the price of the original project.
The point is that you should not be scared of the huge amount of knowledge that exists out there. Most of it you'll likely never need, and as with most fields you need to understand the stepping-stones to understand the advanced part. When you are ready for it, not even the advanced parts will feel that hard to learn.
Challenge yourself! That is the best tip I can give you. When you've written a small application you are happy with in procedural code, try learning how to do it object-oriented. Always look for improvement and be critical of your work. Make sure to appreciate the travel, and not only focus on the goal. Programming should be fun, not stressful.

It surprised me, but PHP no longer generates an E_STRICT when you call a static method through an instantiated object. (Like it used to do, and is pretty much the center of debate) I really believe it still should, but it turns out I was wrong. I don't agree with the change, but it is what it is. I still stand by all of my opinions, but I like to admit it when I'm wrong.
You can "legally syntactically" call a static method though an instantiated object, but you still shouldn't as it's bad grammar and wrongly reflects the logic you are trying to communicate. I think this is a PHP flaw that will only help confuse the difference about procedural code (as static code is) and object-oriented programming.

There are design and syntax reasons for not allowing it, as it doesn't make sense logically. It grays out important destinations between objects and classes. I don't think the change is a good one, but that is beside the point.
As long as you fully understand the difference between objects and classes, that's really what is most important. I'm sorry if I pushed any buttons of yours along the way. It turns out PHP did change along the way, and while I don't agree with it, you where right. I try never to be to proud to admit when I'm wrong.

That is mostly phrasing. This is a syntax and design oriented debate more than an anything. You can't write code like that without experts raising their brows at you. You can't write code like that without breaking object oriented syntax. You can't write code like that without raising warnings.
Can you write code like that in practice? Yeah, but then you don't get the point... You might've picked upon some of my irritation explaining in previous post, and the proper answer is actually just that. You can write code like that, but then you really can't. - Not if you want to be a proper programmer and follow the rules and abstractions of object-oriented design. Code is just expression of logic, so your grammar would be wrong.
Nothing in your quote nor your link contradicts anything said by me or Larry in this thread, btw. I agree with Larry that you focus too much on the lack of a PHP warning. It's still wrong according to syntax, or grammar if you like that analogy better.

My new boss was already familier with you as a writer and have read several of your books. He where seriously imperessed I was asked to give you feedback on your work, no matter how small the task was. I'll send you personal updates when appropriate.

I'm telling you. The error is obviously related to error reporting settings. I even tried it in practice to confirm the behavior. You CAN call a static method by object syntax in PHP, but it WILL raise a warning. You SHOULD still see that output, but PHP will warn you about the usage when you report in accordance to strict standards. The problem might be an old PHP version where those strict standards are not yet applied, but that's merely a guess.

You should be able to change to joins instead and use ORDER BY then.
Everything is very good. I accepted my first full-time job as a Web Developer yesterday. I'll by working with the Symfony2 Stack, EZPublish, some front-end coding and some customer meetings and sales. It's the total dream job for me.
How's life treating you?