Everything posted by sunwukung
-
best way to get twitter feed on your site?
http://wordpress.org/extend/plugins/twitter-tools/ http://www.quickonlinetips.com/archives/2007/04/10-best-twitter-tools-for-wordpress-blogs/
-
Stack Overflow Error
I doubt you're gonna get a stack overflow in an html page...
-
Stack Overflow Error
what was your role in the design - did you do any server side stuff - which system is kicking back the error?
-
Whats the best way to clear floats?
alternatively - you can apply this class ("group") to force divs to self clear their contents: .group:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } This adds a fullstop to the bottom of the div - which in turn behaves like the classic "cleardiv" - but then hides it.
-
ooo controversial
and on that count I would generally assume you were slightly more professional than an amateur or hobbyist. This is an issue of semantics - 'pro' has slightly different connotations than 'professional' (although, as Zed has noted, this isn't always the case, some amateurs/hobbyists are very talented)
-
ooo controversial
I suspect that the quality of output from the professional community is of an overall higher standard than that from the amateur. The existence of anomalies in this general pattern are the exception and not the rule. I hate to say it but, on balance, the quality of work posted for review on closed sites is generally of a higher standard than that which I have seen elsewhere. You are confusing working in a professional context with the degree of experience acquired in that role. That a person is awarded employment is generally the result of an interview - in which instance their work is deemed of a suitably high quality to be considered "professional" (relative to that organisations standards). http://www.thefreedictionary.com/professional
-
ooo controversial
generally speaking, to do something professionally you need to be relatively good at it, no?
-
ooo controversial
pros by definition do know something... Hey, my apologies - that wasn't my intention* . I spend half my time killing spam on here these days - if the forum was invite only, that wouldn't be the case (but then it would't be WDF any more). It can be a little frustrating to see the same questions come up again and again - but hey, I asked them once too! The unfortunate truth is that in an open skill based forum, you are going to see a stratification of users based on experience. My observation has been that advanced users trickle away (often appearing on closed sites like Dribbbl) - make of that what you will. I'm guessing it might have something to do with trying to filter out some of the content that they now find redundant - so Dribbbl shows work from more experienced designers, and so the work tends to be of a higher quality. Having said that, the work in these communities also tends to be more homogenous and "safe" - design memes propagate rather quickly round the "in" crowd. *well, that's not entirely true, I'm just taking a swipe at people not using the "search" facility, or Google for that matter...
-
ooo controversial
I think it has some distinctly positive benefits. Invite only would do a lot of favours for this forum for example - given that it has been reduced to an endless re-run of the following questions: 1: What's the best editor? 2: Why won't this work in IE? 3: I've learnt HTML, what next? 4: Which CMS is best? which means that a lot of the talent that used to frequent this joint have busted out and gone to places like Dribbbl, Fffound and Forrst* to get away from the noobs. This helps to maintain the quality of contributions, block access to the hordes of spammers/SEO hounds. One of the most basic tasks you encounter as a developer is the eponymous login, which by definition is erecting a fence around 90% of sites anyway. *on a negative note, why do all these sites have this thing about dropping vowels and adding consonants...
-
Hit a brick wall with web designer - help required...
It's possible - but for my money the layout is a little overcomplicated - WP isn't ideally suited to it (more of an EE/ModX job IMO) and the biggest issue I can see will be maintaining a consistent vertical rhythm in the middle columns (and the promo boxes)
-
PHP - Essential Skills
I wouldn't sweat it re:ORM - although Doctrine is arguably the best ORM for PHP. ORM is a bit of a coding minefield - and there are some strong feelings surrounding the concept of ORM. In general - an ORM is good for those instances when there is a general 1:1 mapping between a Domain Entity and a DB Table (i.e. User class : users table) - but can rapidly fall apart for anything more complex than a 2 or 3 table join. Moreover, ORM's can require a "de-normalised" DB structure to allow for OOP inheritance. There comes a point when the cost of using an ORM outweighs the benefits. There is an analagous concept - DBAL (Database Abstraction Layer) - that has perhaps more practical implications. Ultimately, a DBAL is an OOP wrapper for your most common DB routines (i.e. selectById, selectWhere). Personally, I prefer DBAL to ORM. I think it's a wierd tradeoff to corrupt your data structure and learn a code based non-optimal version of SQL when the whole chuffing thing is meant to hide all that away for you. DBAL just tidies away some of the more tedious details.
-
JS Scripts - Worth condensing?
Keep em separate during development - push them into one file (and minimise it) for production. A good IDE like Netbeans can reformat minimised JS back into it's original format - but failing that, keep hold of your full fat scripts for later use.
-
PHP - Essential Skills
I agree with Jock (an increasingly frequent event...) although I'd remove the need for certain topics - bitwise operations for example. Personally, I'd be looking for someone with some good understanding of design patterns and associated implications (i.e. Dependency Injection, MVC), a competent degree of knowledge in *nix, good understanding of RDBMS - and a better understanding of how ORM features work in relation to Relational Theory (i.e. the implications of Active Record when using libs like Doctrine/Propel). More importantly than all of this - I'd want someone that ENJOYED coding! Plenty of devs out there that just do it for the cash...
-
Web DESIGNER
After working in this field for a little bit, I have to say I disagree. Web design/development is commonly regarded as a vocation with two paths. This is largely true, the skillset required to be a developer is radically different to that required from a designer. Yet, if we take architecture as an example, if an architect has no concept of engineering - then they will not be a very good architect.
-
MVC - Should I be using one?
My point is that Smarty is (at best) tangential to MVC - and may confuse the OP
-
MVC - Should I be using one?
I see where you're going, but I disagree. Zend isn't the "model" - of all the things Zend provides, the "model" isn't one of them (try googling "Zend framework models"). Zend is first and foremost a library of components, which can be used as an MVC framework. The "Model" is simply that, a "model" of the business domain*. The "view" in MVC is the "user interface". How a View component renders the interface is not important. what IS important is HOW it accesses the Model in order to render that view. The View must not, ever, manipulate the Model - but it can passively observe the model. Swapping out vanilla php foreach loops for Smarty loops is much of a muchness - you're still rendering the content of a variable either way - it is simply an alternative (apparently more legible) syntax for aggregating/rendering variable content - in a nutshell, a templating engine (which is exactly what it's homepage describes it as). Sure, you can use Smarty (or any other templating engine) in a View - if the framework allows for it - but it has no bearing on the MVC architecture. *JFTR - the Model is also not to be confused with data access - Models can contain methods/classes that interact with persistence mechanisms, but the general belief (promoted by frameworks like RoR, Cake and CI) that Models <==> DB Tables is incorrect.
-
MVC - Should I be using one?
1: Building your own from scratch is another job on top of building the e-commerce app. It's worth doing, but you should probably work with an existing MVC framework first to get an idea of how they work 2: If it's your first time round an MVC, I'd go with CodeIgniter
-
How can you use any font in a website
DOH! My bad, you're right - I forgot about font-spring. @asp24 - my point is just that you can't embed whatever you like, you need to check the EULA for the specific font vendor.
-
How can you use any font in a website
There are a variety of methods: sifr, text replacement and of course - @font-face in compliant browsers. Bear in mind, however, that it is illegal to embed fonts without an appropriate license*. Font Squirrel has a great selection of embeddable fonts - as well as some pre-packed webfont kits. http://www.fontsquirrel.com/ * @gfx - if I'm not mistaken, ProximaNova is a commercial font and therefore not appropriate for embedding?
-
Classes Vs Non OOP way
...or in the next year...
-
Clients Requests - Whats the best way to go about this?
sounds like a drupal gig to me.
-
Singleton Pattern - A Few Questions
Singletons are a bit of a marmite pattern...people who advocate Unit testing are generally against them, because they promote tight coupling to global resources which makes it hard to test classes in isolation. The need for static methods points to the real problem - resolving dependencies. Singletons DO have a constructor phase where variables can get initialised. Zend_Registry (and many other application level components) use Singleton - and they get a reference via ::getInstance. You could tie the loading of a config file to that method to get the parameters you need. You could just hard code the connection parameters into the class itself. Personally, I think the solution lies elsewhere - using a Singleton causes more problems than it solves. If you look at this problem another way, the solution may not be to make the class static, rather to have a mechanism in place to load an instance when you need it... My experience is that Singletons are best used for a specific problem - providing resources globally (and is not always the best method to achieve this*). Rather than creating a Singleton to provide database connections - use a Singleton to pass an instance round your system class Registry{ private static $instance; private function __clone(){} private function __construct(){ } public static function getInstance() { if( !isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } public static function get($key){ $instance = self::getInstance(); if(isset($instance->$key)){ return($instance->$key); } } public function set($key,$value){ $instance = self::getInstance(); $instance->$key = value; } } now you can set and get a database connection from the registry instead i.e. Registry::set('dbConn',new DB_Connection($config_file)) Registry::get('dbConn'); Memory issues are another concern you expressed. To be honest - loading a database connection class is pretty negligible. http://phparch.com/2010/03/03/static-methods-vs-singletons-choose-neither/ You can, however, deal with this using a pattern called Lazy Load. http://www.devshed.com/c/a/PHP/Lazy-and-Eager-Loading-in-PHP-5/ *I recommend taking a look at dependency injection, but this is a whole other kettle of fish... http://fabien.potencier.org/article/11/what-is-dependency-injection I also recommend taking a look at this great site: http://sourcemaking.com/design_patterns
-
Business Opportunity - Web Developer
How many hours of work a week so you require from the successful applicant?
-
How to be a better programmer
preface classes and methods with PHPDocumentor legible Doc Blocks and appropriate tags - this will both assist your IDE's autocomplete mechanism (and thus your teams capacity to use your code) and provide anchors for automating documentation when building/deploying/archiving a project. provide inline (//) comments throughout routines to indicate purpose - although arguably methods that are properly scoped to deal with one specific task should not need these comments too often. In practice however, I tend to write code comments (or tests) first - and fill out the implementation details second.
-
Whats your views and opinions on WikiLeaks?
There are two issues here: 1 - regardless of the nature of the crime, I believe that people should be entitled to the protection granted them through their citizenship. If the US can successfully extradite people to be tried according to their laws, well - that's not a good thing (especially given the existence of Gitmo) 2 - freedom of speech is one thing, diplomacy is another. What have these specific leaks achieved that is beneficial to humanity and global peace?