Connect PHP5 to SQL AzureWednesday, October 14. 2009
With SQL Azure right around the corner (expected to go live in November 2009), I had to evaluate if we could migrate some databases 'into the microsoft cloud'.
The pitch from Microsoft senior program manager David Robinson is "With SQL Azure, developers building Web 2.0, ASP.Net and PHP applications can use familiar tools and data models to develop on a pay-as-you-grow, secure, scalable and highly available database service at minimal infrastructure cost,". First, there are limitations, but essentially microsoft is offering a subset of SQL server 2008 running on their infrastructure. SQL Azure is the first hosted database product with good support for Transact-SQL. This means that any application using nearly standards compliant SQL queries could easily be migrated to use SQL Azure. For example, using the MV framework, it could be as simple as changing your connection PostgreSQL: SQL Azure: Since Microsoft has made it relatively easy to connect to SQL Azure from Windows (SQL Server Native Client), this post looks at connecting php5 on unix to SQL Azure. There are two methods to connect to SQL Azure from UNIX. a) Using mssql_connect() b) Using odbc_connect() Once your unix server is properly configured, you can go ahead and test php connections. If all went well, you should see 'Success' everywhere. Be sure to check the version of FreeTDS and unixODBC you are using! If you run into bugs with these tools, well report them or write a patch! My conclusion, although FreeTDS works, it is not enterprise ready and needs some corporate backing. Naturally, this brings the question, what Microsoft is up to? GAE & PHPThursday, April 16. 2009
There's a really easy way to get PHP running on Google's app engine, see this great link:
http://www.webdigi.co.uk/blog/2009/run-php-on-the-google-app-engine/ In short, it works by using 'Quercus' which likely takes the php scripts, transforms and compiles into java bytecode that gets run in the JVM. Don't understand all that? No problem, the important note it is seems to work well. So far I've tested two pieces of code: Memcache Works great. Now, probably the most important reason to use App Engine? Access to your very own google database! Running scalable web services just got a whole lot easier. The bad news is there's no good interface or classes yet with php, so you have to go through using google's 'raw' datastore API. Datastore Unfortunately, it throws a NULL exception. So aside from the quirks, it looks promising. The Datastore API is documented here. Restoring Outlook 2007 accounts in XPFriday, November 28. 2008
I recently had to reinstall Windows XP on a new drive and migrate all my configuration settings.
For the most the part all you need is to copy is most of your data from something like: C:\Documents and Settings\jbondc.COMPUTERNAME Unfortunately, not all programs store their data here, for Outlook 2007 you'll need to copy ~: The third is a registry key under which outlook stores all your e-mail account settings. To export this information, Start -> Run -> regedit Right click on the key and "export", this will create an outlook.reg that you can now copy and execute on the new Windows XP computer. Detailed explanation here: http://www.backuphowto.info/how-to-backup-restore-data-e-mail-account-settings-outlook-2007 I actually find out about this by using a free program from Microsoft to trace system activity, very useful to figure out what programs are doing! http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx There is no 'Save my Settings Wizard' for Office 2007 on Windows XP so this has to be done manually. Hope that helps someone. Small note: you will need to re-enter passwords. Although passwords are copied over, Microsoft very likely use some information about the machine to encrypt and decrypt passwords. This makes sense, you would not want to be able to simply copy someone's encrypted passwords and be able to access all their e-mail accounts. AJAX in the enterprise - BewareTuesday, September 23. 2008
It's great to see the progression to AJAX in the enterprise but I am getting utterly frustrated at how large corporate websites are failing to use and deploy AJAX properly.
I recently tried to create an account for a new American Express card at: https://www99.americanexpress.com/myca/usermgt/us/action?request_type=un_Register I was initially happy to see a nice clean interface. I enter the 4-digit ID, then go on to enter the credit card number. When I finish entering the credit card number, the mouse cursor jumps back to the 4-digit ID (that I already entered!!). Nice try here but not very helpful. The real problems start with the broken registration. The registration page has some interesting focus() tricks which makes a description popup above the focused form field. This is "ok" although the popup/overlay blocks the next form field so you have to hit 'tab' every time. This gets quite annoying. The critical problem obviously is when I click 'submit' to submit my information. The form does nothing and I *see no error*. Wonderful right? Well I hit the 'back' button and I am now "logged in" at: https://home.americanexpress.com/home/mt_personal_cm.shtml I find myself in the "My account" page but if I click any links it brings me back to the login screen. I convinced myself this was an issue with FireFox and tried IE7. I get the same problems. After more registration failures, I finally get a wonderful page: "For your security, your account has been temporarily locked out of the system." What a load of %$&$%? !! AJAX is a very rough technology that requires experts and proper testing, I don't know who American Express subcontracted or the project manager(s) involved but fire who you have to. For a large corporation, and especially a credit card institution (where rigorous security and testing policies should be met), this just looks very very bad. This is not the first time I go though this, the same mess a month ago at http://www.dhl.ca/ca/ FreeBSD 7.0 current - stableMonday, September 8. 2008
Was trying to make a custom kernel for a test machine that was previously running FreeBSD 7.0 CURRENT.
cd /usr/srcThe end result was something like this: >>> stage 3.1: making dependenciesAfter some hair pulling, it turns out that make clean is not always enough: And voila! Hope it helps someone. Mac "for geeks who want to look cool"?Thursday, September 4. 2008
After recently viewing a Mac TV add:
http://www.youtube.com/watch?v=OR2ONmS56DE&feature=related My fiancee turned to me and said "ca m'énerve un peu" (french for "it's starting to be annoying"). Although I'm a fan of Mac ads, the message this time seemed to be over the top and downright annoying. Mac suddenly became for me "try to look cool and annoying" rather then "be cool". I'm not a Mac owner but have been thinking of buying one for a new laptop, at this time I need a little more then the "Mac fashion" message which is really wearing out on me. So here's the options:
If someone is listening, can you please just build an OS that easy to use for everyday use and *that works*, and please shove your marketing down the !?%$È?&$*. Hopefully Microsoft can fix their mess, or innovation with browsers (Google Chrome?) can pave the way for to a new era of computing. Working from home?Thursday, August 21. 2008
Since I work from home 80% of my time and the rest is reserved for meetings with clients (1 day). I found this article very interesting:
http://www.computerworld.com/action/article.do?command=printArticleBasic&articleId=9112621 It warns CEO's or managers to consider 6 questions to answer when considering telework: 1. Is full-time telecommuting a smart decision? 2. How will you define and measure performance? 3. Will creativity suffer? 4. How will telework affect collaboration? 5. What about employees "left behind" in the office? 6. Do you have an exit strategy? Overall it's an excellent summary! If you're thinking about offering telecommuting plans or asking your boss to work from home, you'll enjoy the read. In my field (software development), I see more and more businesses offering telecommuting plans to their tech employees here in Montreal. Why? Their technicians call me from home! Most of the time, they offer 1 day (which turns out to be friday). That seems to fit with: "Still, he won't allow anyone to telework 100% of the time, except in rare circumstances, because he wants to keep informal communications flowing. "That's the kind of relationship I think we'll see more and more of," says Cromwell. "Not somebody telecommuting 100% of the time, but rather creating situations where someone will work from home one or two days a week." And I couldn't agree more, when building a corporate culture, you want your employees to "need" to come to the office. Offering them a day or 2 to work from home should be seen as a bonus where they can reserve time for tasks they 'know' they can get done from home. More then 2 days per week, hire a subcontractor, not an employee. If you're a small team of professionals (2-5) like my company (Goldeneye Solutions) - it's a different issue in the early stage where telecommuting 80% saves time & resources. It's also very important to use proper tools to collaborate, All that said, I'll definitely keep the points in article in mind as I hire more employees. It would be interesting to see how medium or large companies in Montreal are coping with telework? PHP LINQ?Thursday, July 24. 2008
When it comes to writing Web applications, a developer often needs to access data from a multitude of data sources. The result is often a lot of spaghetti code that iterates and filters the results (XML, csv, soap, REST services, and so on).
But the most common data that's accessed is in a relational database. Luckily, at some point database vendors agreed on SQL (standard query language) which is a common way to access /query data from a database. With the reality of the Web, wouldn't it be nice to have some form of standard query language to access many forms of data?? That's what Microsoft's LINQ attempts to offer. It's a great innovation and I was curious about what a PHP API could look like and it turns out there's a good discussion here: http://www.mikeborozdin.com/post/Is-PHPLinq-As-Cool-As-Real-LINQ.aspx The advantage of LINQ in .NET is how the LINQ expressions can be evaluated and compiled. In short, it takes the expressions ("pretty" code) and builds the "spaghetti code that iterates and filters the results" automatically. If the compiler is smart and can make proper machine level optimizations, I would guess it means very fast execution and a standard way of accessing data. Amazing! As for PHP, Maarten Balliauw still went ahead and created a PHP implementation of LINQ: http://www.codeplex.com/PHPLinq/Release/ProjectReleases.aspx?ReleaseId=10084 It's definetly "interesting" at this point and if PHP could support natively some form of LINQ, it would be a major achievement and very cool stuff. There's also a java version of "LINQ" (Quaere): http://www.theserverside.com/news/thread.tss?thread_id=46887 Distributed Cache - VelocityWednesday, June 4. 2008
I always enjoy reading Microsoft tech announcements simply because they just seem to "nail" business requirements and building the proper solutions / technology.
The quote the announcement: "Distributed cache is becoming the key application platform component for providing scalability and high availability. In-memory caching has been traditionally used primarily for meeting the high performance requirements of applications. By fusing caches on multiple nodes into a single unified cache however, the distributed caches offer not only high performance, but also scale." Microsoft released a first CTP (technology preview) of their distributed caching technology called Velocity: From the readme: "Velocity" distributed cache is provided in the form of a cache cluster, simplifying your application code by managing the complexities of load balancing behind the scenes. When you use "Velocity," you can retrieve data by using keys or other identifiers, called tags. "Velocity" supports optimistic and pessimistic concurrency models and a variety of cache configurations. For those familiar with memcache (open-source), it's the same type of solution. Velocity however seems to be a much more enterprise ready package with advanced caching features. It's further interesting that Velocity uses ports: 22233 (data) and 22234 (monitor cluster nodes), looks like we're going to need a distributed caching 'RFC' and protocol some time soon. The full announcement is here: http://blogs.msdn.com/velocity/archive/2008/06/02/introducing-project-codename-velocity.aspx Short PHP array synthaxFriday, May 30. 2008
There's an RFC that has been recently declined through the PHP internals list. It is a minor change/patch to introduces a short synthax to declare arrays in PHP.
To declare an array in PHP, you currently use the following synthax: The proposed patch (a few lines) would allow to declare arrays in a shorter form: This notation is used by many programming languages, most notably javascript. Since PHP is essentially a programming language used for the Web, my opinion is it makes perfect sense to support a javascript-like notation for arrays. There's some resistance from the core developers and overall there were too many veto (negative) votes. I definitely understand their concern but feel it's a natural evolution of the language, this to me seems like something most users would want to see in PHP. Hopefully, the PHP community can speak out enough to get better idea of what the users / php community wants. The actual proposal and more info at: http://wiki.php.net/rfc/shortsyntaxforarrays. Advantages of BSDMonday, May 12. 2008
This one made me smile so I had to share it, there's a 25 year old bug that has just been fixed with seekdir() on all BSD systems. For details, see
http://www.osnews.com/story/19731 And the actual patch for FreeBSD is now available: http://www.nabble.com/i386-121656:--libc---PATCH--telldir-issues-td16019215.html There's something wonderful about the open-source community and how problems get fixed... well eventually BSD is a great license to study, modify and learn from software but also to collaborate with people from many different backgrounds, academic (research & students), corporate, hackers and so on... Happy BSDing Bad Trade Day!Tuesday, February 26. 2008
The HABS today have failed to grab Hosa from the Atlanta Trashers. It's a major disappointment for myself and all fans who were hoping to see the sharp shooter at Montreal!
It's not so shocking that we failed to get Hosa but that the HABS have given away Huet to the Washington Capitals for a mere second round draft pick. The valuation of our ex-#1 keeper seems both humiliating for HUET and the HABS. After listening to Bob Gainey's press release, I'm still stunned by the news. Though I'm happy to see Carey Price as the future of the habs in net, my immediate reaction is we gave away Huet for very little in return. Running dojo or javascript tookit on the SERVER side?Thursday, February 14. 2008
If you are not familiar with .NET and the precious runat="server" or runat="client", have a look a at: http://www.aptana.com/jaxer
The idea is simple and very very practical. In some situations, you may want to run code on the server OR on the client. The problem with a lot of javascript frameworks is they do a LOT of work on the client side. What if we could make the server work a little harder? Based on John Resig's work, http://ejohn.org/blog/bringing-the-browser-to-the-server/ I convinced myself I could create a "template parser" for dijit widgets that would read the following tags: The first part was making sure that a dijit widget could be created on the server side. Amazingly after some tweaks, this works: The template parser has now been written and several more tests are needed before a first release! Sun-mySQL or Sun-PostgreSQL?Monday, January 21. 2008
It's old news by now but I was recently reading "Sun buys mySQL" articles such as this one:
http://devzone.zend.com/article/2979-Did-you-hear-Sun-was-buying-MySQL I think like lots of PostgreSQL fans, I was first shocked by Sun's move. Sun has been sponsoring PostgreSQL for quite some time now which in my opinion currently stands the best open-source database for the enterprise. So why did they buy mySQL? Popularity & Marketing mySQL seems to be the poster boy for web 2.0 and building a database driven website. Historically, the mySQL DB driver has been bundled with PHP natively, so it quickly became the 'M' in the LAMP stack and the open-source database. It has a catchy name and does most of what you would expect from a database. For me, there's no doubt that it makes sense for Sun to buy mySQL and offer better support for the database. The Itch The hopes for every postgreSQL fan is that Sun will not favor mySQL over PostgreSQL. In fact, the hope is that Sun can help steer mySQL to a direction closer to postgreSQL, i.e. support more properly the SQL standard and everything a relational database should offer. For postgreSQL to gain wider adoption, it definetly needs a name change! But then again, maybe the wonders of postgreSQL are best kept as a "secret"? Debate over Proposed ECMAScript 4th EditionThursday, November 1. 2007
There's a new exciting debate over the ES4 proposal which is available online at:
http://www.ecmascript.org/es4/spec/overview.pdf The reason?Besides some people arguing over the complexity and possibly over-engineering of the new language, there are major corporate implications. Microsoft may not want to implement ES4 and it's quite unclear what their plans are with IE8. Does it make sense for Mozilla, Opera and Safari to implement a new javascript engine if Microsoft (IE) doesn't follow? Probably not.But some might say, implement the standard and let Microsoft (possibly) follow up later. The problem is that for developers (scenario: IE doesn't implement the standard), we are stuck in the same interoperability mess when building web applications. Hack and hack after hack to support either buggy or non-existing implementations! It's further unclear if Microsoft has any interest for javascript to succeed in the long run and become a driving force in the success of web applications. The corporate strategy of Microsoft is not transparent with regards to their web technology such as Silverlight (brings .NET to the browser). In short, business is getting in the way of collaboration and benefiting the end users. On the other end, it's unclear how Adobe and Mozilla are related and if the donation of actionscript to Mozilla puts Firefox at an advantage to implement this proposed standard compared other browsers (IE, opera etc...). Open StandardsNo doubt, the solution is for browser vendors to actively implement and support a javascript engine according to the same standards. It will be interesting to see how this unfolds, important communication and decisions are ahead with regards to new web standards.On a personal note, I like some parts of the proposed standard though I believe there's some over engineering with the type hinting. I am a strong fan of interfaces and classes.
(Page 1 of 2, totaling 17 entries)
» next page
|
Calendar
QuicksearchArchivesCategoriesSyndicate This Blog |
|||||||||||||||||||||||||||||||||||||||||||||||||