friend connect

jay sean

Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Tuesday, January 25, 2011

Using CURL in XAMPP

There appear to be a lot of misguided people on the intarwebs claiming all sorts of varying things you have to do to get CURL to work on a Windows-based XAMPP install. I’d like to clear them all up here and now.

Using CURL in XAMPP

It’s really quite simple - uncomment extension=php_curl.dll in your php.ini file, then restart Apache1.
A lot of confusion seems to stem from the fact that there are multiple php.ini files in a standard XAMPP install. This really isn’t as confusing as you’d think it would be, assuming you - and I know I’m going out on a limb here - read the documentation.
There’s a straight-forward XAMPP FAQ Entry about their php.ini stucture. For those looking for the easy fix, ignore everything but the /apache/bin/php.ini file. That’s the only one that counts, regardless of which PHP version you’re currently using.
What about all the .dll files you need? Well, you don’t need them. Everything you need to run CURL on a XAMPP install is included in the download. Stop downloading extra crap and sticking it all over your system. XAMPP knows what it needs, where it’s at, and how to use it. End of story.
This is all based on the XAMPP Basic Package for Windows, version 1.6.1, released on 4/18/2007. YMMV.
Update for XAMPP 1.7.x: As of the 1.7.0 release, the php.ini file is found in /xampp/php. When in doubt, consult the FAQ entry linked above for help. Thanks to several commenters for pointing out this change!
Restarting Apache is required on both Windows and Linux whenever you make configuration changes.

Tuesday, December 21, 2010

What does !important mean in CSS?

Answer: Cascading Style Sheets cascade. This means that the styles are applied in order as they are read by the browser. The first style is applied and then the second and so on. What this means is that if a style appears at the top of a style sheet and then is changed lower down in the document, the second instance of that style will be the one applied, not the first. For example, in the following style sheet, the paragraph text will be black, even though the first style property applied is red:
p { color: #ff0000; }
 p { color: #000000; }
The !important rule is a way to make your CSS cascade but also have the rules you feel are most crucial always be applied. A rule that has the !important property will always be applied no matter where that rule appears in the CSS document. So if you wanted to make sure that a property always applied, you would add the !important property to the tag. So, to make the paragraph text always red, in the above example, you would write:
p { color: #ff0000 !important; }
 p { color: #000000; }

User Style Sheets

However, the !important rule was also put in place to help Web page users cope with style sheets that might make pages difficult for them to use or read. Typically, if a user defines a style sheet to view Web pages with, that style sheet will be over-ruled by the Web page author's style sheet. But if the user marks a style as !important, that style will overrule the Web page author's style sheet, even if the author marks their rule as !important.
This is a change from CSS1 to CSS2. In CSS1, author !important rules took precedence over user !important rules. CSS2 changed this to make the user's style sheet have precedence.

Tuesday, October 26, 2010

Ajax Talk at .NET Developers Association


Thanks everyone who came to my Ajax talk tonight at the .NET Developers Association! The slides and demos from the talk can be downloaded by clicking the following link:


You need Visual Studio  2010 to view the code samples. The first project, named Demos, contains the following samples:
  • ASPAjax4
    • 1_CompositeScripts.aspx – Demonstrates how to use the ScriptManger to combine, compress, and cache JavaScript files automatically.
    • 2_EnableCdn.aspx – Demonstrates how to retrieve ASP.NET Ajax framework scripts from the Microsoft Ajax CDN automatically.
  • jQuery
    • 1_Selectors.aspx – Demonstrates how to use jQuery selectors
    • 2_WebForms.aspx – Demonstrates how to use the client tablesorter plugin with ASP.NET Web Forms.
    • 3_MVC.aspx – Demonstrates how to use jQuery animation and the templating plugin with ASP.NET MVC.
    • 4_OData.aspx – Demonstrates how to use jQuery with the Netflix API by using JSONP and odata.
    • 5_Templating.aspx – Demonstrates how to use jQuery client templating.
    • 6_TemplateConditionals.aspx – Demonstrates how to use logic within a jQuery template.
    • 7_DataLinking.aspx – Demonstrates how to perform data-binding in jQuery.
    • 8_Converters.aspx – Demonstrates how to defines converters that work with data-binding.
The second project, named ACT_Tools, illustrates how to use the Microsoft Ajax Minifier and the JSBuild JavaScript preprocessor. When you perform a build in Visual Studio, all JavaScript and CSS files are minified automatically. Furthermore, any *.pre.js file is processed using the JSBuild preprocessor and the output is saved to the ScriptOutput folder. Select Show All Files in Visual Studio to see the generated results of the minifier and the preprocessor.

jQuery UI on the Microsoft CDN


The jQuery UI team just added jQuery UI to the Microsoft Ajax Content Delivery Network (CDN). Thanks to them, you can start using jQuery UI in your ASP.NET websites by linking to jQuery UI at the following address:
http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/jquery-ui.js
You can start using the CDN now for free. No registration is required.
Using jQuery UI from the CDN can substantially improve the performance of your production ASP.NET websites. The Microsoft CDN is composed of servers distributed around the world. When users request a page from your website, the users can retrieve jQuery UI from a server located geographically close to them.
In addition, because browsers cache JavaScript files relative to a domain, serving jQuery UI from a CDN enables your website users to avoid downloading jQuery UI when visiting multiple websites. If you visit two websites that both use jQuery UI from the Microsoft CDN then the jQuery UI library only needs to be downloaded once.
Learn more about the Microsoft Ajax CDN by visiting the following website:
http://www.asp.net/ajaxlibrary/cdn.ashx
This website is being updated with the location of all of the jQuery UI library files.

Using the jQuery UI Datapicker from the Microsoft Ajax CDN

The jQuery UI Datepicker (http://jqueryui.com/demos/datepicker/) enables you to easily display a pop-up calendar. Here’s a complete code sample of using this plugin:
Listing 1 – Using the jQuery UI Datepicker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title>jQuery UI from Microsoft Ajax CDNtitle>
    <link type="text/css" rel="Stylesheet" href="http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/themes/redmond/jquery-ui.css" />
head>
<body>
    <form id="form1" runat="server">
    <div>
     
        <input id="startDate" />
  
    div>
    form>
    <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js">script>
    <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/jquery-ui.js">script>
    <script type="text/javascript">
        $("#startDate").datepicker();
  
    script>
body>
html>

When you open this page, and click (or tab) inside the input field, you get a popup calendar:
clip_image002
Notice that the page above includes the following link to a jQuery UI theme:
All of the standard jQuery UI themes are hosted on the Microsoft Ajax CDN. I am using the standard jQuery UI Redmond theme – naturally :).

Additional jQuery Plugins on the CDN

We are inviting the authors of the top jQuery plugins to add their plugins to the CDN. Pay attention to this blog over the next few months to learn about the new jQuery plugins added to the CDN.
I’m super excited about having jQuery UI on the Microsoft CDN. Having jQuery UI on the CDN will make it easier for ASP.NET developers to build ASP.NET applications that support rich and interactive user interfaces.

Followers