Archive for October, 2009

Change or Alter multiple database table schema

Sometime as a database developer, we might come across changing the schema for the whole database

This is one way to do it; by generating multiple queries in the query editor:

SELECT ‘EXEC(‘’sp_changeobjectowner @objname = ””oldDBO.’ + name +’ ”” , @newowner = dbo”) ‘

FROM sys.tables

WHERE schema_id = SCHEMA_ID(‘oldDBO’);

Also below is the drop multiple tables by query from the sys.objects.

In this change where is by order date:

SELECT * INTO #tables from sys.objects where create_date > ‘2009-10-27 21:47:20.993′

while (SELECT count(1) FROM #tables) > 0

begin

declare @sql varchar(max)

declare @tbl varchar(255)

SELECT top 1 @tbl = name FROM #tables

SET @sql = ‘drop table ‘ + @tbl

exec(@sql)

DELETE FROM #tables where name = @tbl

end

DROP TABLE #tables;

, , , , , ,

No Comments

Flash content and z-index

Wednesday December 1, 2004

Just to set up the scene, a project I am working on requires a Flash navigation set. To tackle the obvious accessibility issues, I have created a run of the mill XHTML list of links that mirrors the Flash version exactly and hidden it from visual browsers using CSS. This is all fine. I have placed the Flash navigation set at the very bottom of the XHTML and positioned it back to the top of the page using CSS, so no major problems there.

The problem really starts when I realise that the Flash content is overlapping two other elements of the page, namely a site wide search form and a logo which doubles as a link back to the home page and, as you would expect, due to it’s position within the page structure it is on the top of this ’stack’ meaning I can’t use the search form and I can’t see the logo,let alone click it.

Flash stacked by default

These three elements, for the sake of simplicity, are each contained within a uniquely identified div tag and are positioned absolutely. The obvious answer is to use z-index to move the two divs above the Flash content but (insert Eddie Izzard accent here) it does not work! The reason, as explained by Macromedia

A Flash movie in a layer on a DHTML page containing several layers may display above all the layers, regardless of the stacking order (“z-index”) of those layers.

That’s all a little bit upsetting I must say. Luckily, the same tech note from Macromedia goes on to explain how you can use the wmode tag to create a transparent background for your Flash content, thus allowing the layers underneath to show through. Support for this method is now pretty widespread for newer browsers (CHECK THIS TECH NOTE FOR BROWSER SUPPORT DETAILS!). I am not overly worried about older browsers because, chances are, I am going to serve up a simplified version for Netscape 4 and his buddies anyway and, as I am using Flash MX specific ActionScript to deliver the content, the user will have to have Player 6 to see the content, so no worries about older versions of the player; such are the decisions you have to make when working with Flash!

Okay, so using Drew’s Flash Satay method my code for the Flash content looks something like this

  1. <object
    type=”application/x-shockwave-flash” data=”/flash/navbar.swf”
    width=”750″ height=”90″>
  2. <param name=”movie” value=”/flash/navbar.swf” />
  3. <param name=”wmode” value=”transparent”>
  4. </object>

Line three is the key to the whole thing and adding this, as said, I can now see my logo and my search form, I still can’t get to them to use them though!

Flash with transparent background applied

This is where the tech note got a bit fuzzy for me and the reason I am making this post; it says

Newer browsers add the ability to layer Flash content with DHTML content and in some cases the ability to use transparent backgrounds in the Flash content.

This, to me at least, suggests that I shouldn’t have run into the problems I did when using a newer browser, such as Firefox or Internet Explorer 6 (Update: Reading this back maybe the DHTML bit should have been a clue as to why I hit problems, I don’t have the D bit!). The z-indexing should have worked straight out of the box but it didn’t.

So, as I understand it thus far, I would say that, for the moment at least, you must include the wmode tag if you want the ability to ‘layer’ the flash content using CSS alone.

With this done and the appropriate CSS in place (e.g. #id{position:absolute; z-index:1;}. My search form, flash navigation and logo are all nestling happily together at the top of the page and I can go and have a nice glass of wine! hooray!

Flash stacked with transparent background and z-indexing

via: http://joshuaink2006.johnoxton.co.uk/blog/82/flash-content-and-z-index

, , ,

No Comments

Creating Cooliris plugin for www.zenphoto.org

About Zenphoto
Zenphoto is an answer to lots of calls for an online gallery solution that just makes sense. After years of bloated software that does everything and your dishes, zenphoto just shows your photos, simply. It’s got all the functionality and “features” you need, and nothing you don’t. Where the old guys put in a bunch of modules and junk, we put a lot of thought. We hope you agree with our philosopy: simpler is better. Don’t get us wrong though –zenphoto really does have everything you need for your online gallery, and you’ll even stare in awe at some of the innovative innovations we innovated upon. Here are some of the wonderful things about it. Read more…

What is Cooliris?
It’s simply the fastest and most stunning way to browse photos and videos from the Web or your desktop. Effortlessly scroll an infinite “3D Wall” of your content without having to click page to page, whether you’e on Facebook, Google Images, YouTube, Flickr, Picasa, Kodak Gallery, or any supported site. Or channel surf the latest news, TV episodes, movies, and music videos all from within Cooliris. Readmore…

Bugs found on zenphoto 1.2 using php 5.3

PHP Deprecated: Function ereg() is deprecated in …\zp-core\functions-i18n.php on line 305
This errors in php 5.3 (latest php version). Replace funciton ereg() to preg_match()
Example:
ereg(‘([A-Za-z]{1,2})(-([A-Za-z0-9]+))?(;q=([0-9\.]+))?’,$lang,$found);
to
preg_match(‘/([A-Za-z]{1,2})(-([A-Za-z0-9]+))?(;q=([0-9\.]+))?/’,$lang,$found);

Demo
www.klephoto.com

Download Zenphoto-Cooliris Plugin
download will be available soon, please check back!

,

No Comments

phpDesigner 7 – The greatest php IDE

Powerful PHP IDE and PHP editor with built-in HTML, CSS and JavaScript editor. Fast. Powerful. Time-saving!

phpDesigner 7 is more than just a powerful and lightning fast PHP IDE and PHP EDITOR – it’s also a full-featured HTML-, CSS- and JavaScript editor boosted with features so you can get your work done — for both beginners and professional developers!

phpDesigner 7 assists you with everything from editing, analyzing, debugging to publishing websites powered by PHP, HTML, CSS to JavaScript plus other languages!

phpDesigner 7 supports not only working with your favorite PHP frameworks but also popular JavaScript frameworks jQuery, Ext JS, YUI, Dojo, MooTools and Prototype!

Feature loaded but still fast and intuitive to use and learn!
Full-blown PHP, HTML, CSS and JavaScript editor!
Advanced code tip and code completion with OOP!
Debug and profile your PHP scripts with Xdebug!
Work with all PHP- and popular JavaScript frameworks!
Work with files over FTP/SFTP and TortoiseSVN support!
  • New. JavaScript code completion
  • New. Support for JavaScript Object-oriented programming (OOP)
  • New. JavaScript code tip with extended information/documentation
  • New. Support for user-defined JavaScript functions
  • New. Support for user-defined JavaScript variables
  • New. Code Explorer for JavaScript
  • New. Jump to JavaScript declarations
  • New. Support for the JavaScript framework ExtJS
  • New. Support for the JavaScript framework jQuery
  • New. Support for the JavaScript framework Yahoo! UI Library (YUI)
  • New. Support for the JavaScript framework Dojo
  • New. Support for the JavaScript framework Prototype
  • New. Support for the JavaScript framework MooTools
  • New. Added JavaScript operators to the JavaScript menu
  • New. Added JavaScript Statements to the JavaScript menu
  • New. Added JavaScript single line comment to the JavaScript menu
  • New. Added JavaScript multi-line comment to the JavaScript menu
  • New. Added History() to the JavaScript menu
  • New. Code Explorer for CSS
  • New. Jump to CSS declarations
  • New. Code completion can now suggest the closing tag for HTML/XHTML
  • New. Code completion can now suggest the closing tag for XML
  • New. Inline JavaScript code completion in HTML/XHTML (in events like onclick=”…”)
  • New. Inline CSS code completion in HTML/XHTML (style=”…”)
  • New. Option to delay the PHP syntax check
  • New. Added support for SFTP
  • New. Support for SFTP using password
  • New. Support for SFTP using key
  • New. Option to customize the ftp/sftp name in the ftp/sftp manager
  • New. Added Bookmarks to the Go to menu
  • New. Support for Google Chrome (browser preview)
  • New. Support for Microsoft’s Bing search engine (Live has been removed)
  • New. Upgraded to the latest version of HTML Tidy
  • New. Upgraded to the latest version of PHP (version 5.3) and configured with Xdebug
  • New. Optimized memory usage on big projects (declarations is now compressed e.g. from 40MB to 15MB for parsed data)
  • New. Force loading files as UTF-8 (Preferences > General)
  • New. By default the syntax for PHP is now delayed with 3seconds (previously 1 second)
  • New. Support for text output (embedded browser – before only support for formatted/html output)
  • New. Dialog to edit default templates
  • New. Code completion with supported parameters in the dialog for editing the default templates
  • New. Option to edit the default HTML/XHTML template
  • New. Option to edit the default CSS template
  • New. Option to edit the default XML template
  • New. Option to edit the default JavaScript template
  • New. Option to edit the default VBScript template
  • New. Option to edit the default SQL template
  • New. Option to edit the default Perl template
  • New. Option to edit the default Java template
  • New. Option to edit the default C# template
  • New. Option to edit the default Python template
  • New. Option to edit the default Ruby template
  • New. Option to edit the default Smarty template
  • New. Option to edit the default No syntax template
  • New. Save to FTP button added to the File toolbar
  • New. Copy to FTP button added to the File toolbar
  • New. By default the Keep text is now on (Preferences > Editor > Code completion)
  • New. Added Go to menu (Go to declarations etc.)
  • New. Select file from the menu File has now been renamed to Go to file and moved to the menu Go to
  • New. Project files has been renamed to Go to project file and moved to the menu Go to
  • New. Code tip now supports overloaded functions
  • New. Code completion now support catch(Exception $e) // $e-> will hold Exception class
  • New. Support for ‘user initialized’ functions (similar as variables)
  • New. Support for function parameters initialized by PhpDoc keyword @param
  • New. Code tip now supports multiple __construct
  • New. Support for class completion for variables in local scope from global namespace (global $a; $a->[CC])
  • New. Link to Facebook in the menu About
  • New. Link to Support in the menu About
  • New. Panels button added on the Window toolbar
  • New. Color selector
  • New. Added comment to the CSS style block (menu CSS)
  • New. Added CSS comment /* */
  • New. @Import CSS file
  • New. Added wizard for creating new sibling CSS Selector
  • New. Added wizard for creating new child CSS Selector
  • New. Added wizard for creating new pseudo CSS Selector
  • New. Link to support in the menu Help
  • New. Link to the Facebook Page for phpDesigner
  • New. Link to Tutorials and Resources
  • New. If you open a file without a file extension it will now use by default the intelligent syntax highlighter (preferences)
  • New. On drop files on editor area you can now set it to either open the file or insert it as a url (preferences)
  • New. Option to disable the JavaScript code completion and code tip (preferences)
  • New. Option to skip the Print Preview (preferences)
  • New. Option to insert the current file directory in the Search dialog
  • New. Added support for more special characters in the special characters dialog
  • New. Support for TortoiseSVN “Resolve”
  • New. Support for TortoiseSVN “Log”
  • New. Swedish language file added
  • New. Croatian language file updated
  • New. Spanish language file updated
  • Fixed. By default the find/replace dialog will automatic close after the search
  • Fixed. Find/replace in all opened documents (previously it marked all files as modified)
  • Fixed. Code beautifier for PHP (before it removes the space between the variable and the variable type)
  • Fixed. Scrolling with the mouse inside the embedded browser in phpDesigner
  • Fixed. Configuring the output directory for Xdebug profiler only if php.ini exists
  • Fixed. The PHP window is now only displayed if there are errors/warnings on Run
  • Fixed. Support for changing colors for special tags like <?php ?>
  • Fixed. Reload project renamed to Rescan Project
  • Fixed. Search bar inside the embedded browser has been removed use instead the default one in the web browser
  • Fixed. Better cleanup of unused tmp files when debugging and running files
  • Fixed. The Preview and Run button has been merged into just Run
  • Fixed. If file is not modified the tmp file on Run will be ~ + filename
  • Fixed. If file is modified the tmp file on Run will be ~~ + filename
  • Fixed. Jump to declaration improved for especially self::/parent::/$this->/$someObj->
  • Fixed. Application manager
  • Fixed. Better resolving object properties
  • Fixed. Better visibility in code tip for parent/self/$this/__construct/extends
  • Fixed. Better support in code completion and code tip for parent:__constructor()
  • Fixed. Class body completion for interface methods
  • Fixed. Fix constructor support for build-in objects
  • Fixed. Renamed code completion option “If no match found, select the first item” to “Auto-select first item”
  • Fixed. If file contains error the debugger (Xdebug) will now alert why it cannot start and jump to the error
  • Fixed. Better text/icons for Web search and searching in the PHP manual
  • Fixed. Export CSharp syntax highlighter (Preferences)
  • Fixed. Import CSharp syntax highlighter (Preferences)
  • Fixed. Export VBScript syntax highlighter (Preferences)
  • Fixed. Import VBScript syntax highlighter (Preferences)
  • Fixed. Export CSS syntax highlighter (Preferences)
  • Fixed. Import CSS syntax highlighter (Preferences)
  • Fixed. Clear all search marks in opened files
  • Fixed. Auto-closing html/xhtml tags is now by default on
  • Fixed. Default path for the syntax check for PHP
  • Fixed. Inserting a phpDoc from the toolbar
  • Fixed. phpDoc indention on pressing Enter
  • Fixed. Bookmark positions after performing a search/replace
  • Fixed. Strip HTML/XHTML tags
  • Fixed. Printing and dimming
  • Fixed. Setting the Xdebug profiler output path (support for Vista and Windows 7)
  • Fixed. Default bold <b> has been replaced with <strong>
  • Fixed. Default italic <i> has been replaced with <em>
  • Minor fixes and improvements

Download for 21 days free trial

, ,

No Comments

Godaddy Promo Codes and Renewal Domain Discount

Here are the latest GoDaddy promo codes. I used POSTER9 to renew My Domain and worked great with no problem

POSTER9 – Saves you 30% off on .com renewals and new registration

POSTER8 - Gives you 20% off $50 or more

POSTER7 – Saves you 10% on everything else

POSTER20H – 20% OFF WEB HOSTING

POSTERSSL – $12.99 STANDARD SSL (Saves $17)

POSTER25 – Save 25% on Hosting and any orders over $91

OK9 – $7.49 .COM

OK7 – 10% off any order not already discounted

OK8- 20% off orders over $50

OK20H – 20% OFF WEB HOSTING

OKSSL – $12.99 STANDARD SSL (Saves $17)

OK25 – Save 25% on Hosting and any orders over $91

, , ,

No Comments

Girlbot sings: the HRP-4C prototype humanoid robot demonstrated singing skills at Ceatec in Japan

,

No Comments

Fundamental Concept of Object Oriented Programming

Classes        :> Entities:NOUNS                   => ex: [PERSON]

Properties :> Description:Adjectives   => ex: [FirstName, Age]

Methods     :> Actions:Verbs                     => ex: [Add,Delete]

Events         :> Behaviors:Occurrences   =>ex: [Added,Deleted]

,

No Comments