Articles Tagged 'Internet'


jQuery: round edges on the images to overlap

Because of the different rendering across browsers, Microsoft Internet Explorer definitely see that in mind, we must always resort to tricks to apply special effects that now should be a standard. The award-discussed rounded edges are a classic example of "disaster" produced by the complete inability to make a serious standards on pages render HTML / CSS. , etc… There are many solutions that allow the network to obtain the "effects" (effects which present as exempt from the HTML rounded corners, shadow effects, reflections, etc ...) with patches on the leaves of styles, special tricks using div grafted, libraries Javascript, use of canvas , etc ...
On a purely educational I will illustrate further technique (cross-browser) to apply to the rounded edges of the images:

Demo and source

More ...

Creating Desktop Applications with Google Chrome and Firefox?

Google Chrome allows you to create desktop applications from a Web page? In fact, as shown in the menu item is only allowed to create a shortcut to a link which - in turn - open a window without address bar and without all the "frills" of the browser. This does not mean that we have created a desktop application, we have just created a link to the same Google Chrome mode - so to speak-chrome-less.

Feature simle, but more ambitious, had already been proposed by the Mozilla Foundation in 2007, via Project Prism . This is certainly the most versatile and articulate, even accompanied by a useful extension that allows you to create desktop applications menu of FireFox, the same way as Google Chrome .

However, both solutions are far from technology Adobe AIR . Before anyone confuses it should be noted the substantial differences between a desktop shortcut that opens a window with no menus, and a desktop application and its true.
Adobe AIR , in fact, unlike the solutions offered by Google Chrome and Prism allows you to:

  • Virtually complete access to the system running the application with the ability to read and write files. Possibility to extend its functionality via dll (dynamic link library), extensions and third-party products such as SHU Player (see Deploy Adobe AIR: AIR Badge from a SHU Player )
  • Manages the application as the other system applications: Install and Uninstall

More ...

WordPress: write a personal logout

Based on the post WordPress: step by step how to create their own login , run the login procedure could be useful to indicate in our Blog Link to disconnect or log out. We will not use again the standard procedures of WordPress, but as we will see log out at a low level. First we must determine whether a user is logged in or not. This is possible simply by querying the variable $user_ID WordPress. For example:

1
2
3
$user_ID != '' ) { // oppure if( is_user_logged_in() ) { if ($ user_ID! ='') {/ / or if (is_user_logged_in ()) {
/ / A user is "logged in" ...
}

Once we know who a user is "logged" into the system, we can insert a simple link to our logout page. We thus create a page, for example, logout.php , seguende and entering the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
/ **
* Performs the logout
*
* @ Author Giovambattista Fazioli
* @ @ Email g.fazioli undolog.com
* @ Web http://www.undolog.com
* /
/ / Invoke WordPress bootstrap
( 'wp-config.php' ) ; @ Require_once ('wp-config.php');
( 'wp-includes/pluggable.php' ) ; @ Require_once ('wp-includes/pluggable.php');
/ / Wp logout
wp_logout ();
/ / Load any other page
"Location: /" ) ; header ("Location: /");

And just then "link" to our page to provide a logout procedures:

1
2
3
$user_ID != '' ) { if ($ user_ID! ='') {
; echo 'Run <a href="logout.php"> logout </ a>';
}

More ...

Very short trick: undefined values ​​in Javascript

Is there a shortcut to assign "on the fly" a value to a variable if one is not defined (undefined), using the logical OR operator (| |) - double pipe:

1
2
3
4
5
/ / Foo is undefined
var bar;
pluto || '5' ; var foo = bar | | '5 ';
pippo ) ; alert (foo);
/ / Result: 5

More ...

CSS3: has anyone seen the Internet Explorer?

I just do not ...

1
2
3
4
5
6
7
8
9
{p
/ * Rounded Corners * /
; /* CSS 3 */ border-radius: 9px; / * CSS 3 * /
; /* Opera */ -O-border-radius: 9px; / * Opera * /
; /* iCab */ -ICab-border-radius: 9px; / * iCab * /
; /* Konqueror */ -Khtml-border-radius: 9px; / * Konqueror * /
; /* Firefox */ -Moz-border-radius: 9px; / * Firefox * /
; /* Safari */ -Webkit-border-radius: 9px; / * Safari * /
}

More ...

A class countdown in Javascript

In the post with 3D CountDown FIVe3D (see also How I Did It: write a countdown in Flash ), was given a class for creating an object in Actionscript CountDown, here's a similar version in Javascript:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/ **
* Class CountDown
*
* @ Author Giovambattista Fazioli
* @ @ Email g.fazioli undolog.com
* @ Web http://www.undolog.com
*
* @ Param dd (string) 'month day, year'
*
* /
dd ) { function countdown (dd) {
/ / Init target time
new Date ( dd ) ; var target = new Date (dd);
= target. getTime ( ) ; this. targetTime = target. getTime ();

/ **
* Refresh countdown
* /
= function ( ) { this. refresh = function () {
new Date ( ) ; var today = new Date ();
today. getTime ( ) ; var today = currentTime. getTime ();
/ / Time left
( this . targetTime - currentTime ) ; this. _leftMilliseconds = (this. targetTime - currentTime);
Math. floor ( this ._leftMilliseconds / 1000 ) ; this. _leftSeconds = Math. floor (this. _leftMilliseconds / 1000);
Math. floor ( this ._leftSeconds / 60 ) ; this. _leftMinutes = Math. floor (this. _leftSeconds / 60);
Math. floor ( this ._leftMinutes / 60 ) ; this. _leftHours = Math. floor (this. _leftMinutes / 60);
/ / No module
= Math. floor ( this ._leftHours / 24 ) ; this. leftDays = Math. floor (this. _leftHours / 24);
/ / For print
= this ._leftMilliseconds % 1000 ; this. leftMilliseconds = this. _leftMilliseconds% 1000;
= this ._leftSeconds % 60 ; this. leftSeconds = this. _leftSeconds 60%;
= this ._leftMinutes % 60 ; this. leftMinutes = this. _leftMinutes 60%;
= this ._leftHours % 24 ; this. leftHours = this. _leftHours 24%;
}
( ) ; this. refresh ();
}

Example

1
2
3
new countDown ( '1 1, 2009' ) ; var cd = new CountDown (1 '1, 2009 ');
/ / Show how many days, hours, minutes, seconds and milliseconds to January 1, 2009

More ...

Very short trick: avoid error message in PHP

If we do not want a PHP function to issue any warnings or errors, just enter the first call to the spiral nature - or at - (@):

1
2
3
4
/ / Instead of using the canonical form
miaFunc ( ) ; $ Res = miaFunc ();
/ / You can use
miaFunc ( ) ; $ Res = @ miaFunc ();

More ...

Very short trick: PHP echo car

In PHP you can use an abbreviated form, or contracted, to display variables or returns of functions:

1
2
3
4
5
6
7
8
/ / In place of
$miavar ?> <? Php echo $ miavar?>
/ / You can write
?> <? = $ Miavar?>
/ / In place of
miaFunc ( ) ?> <? Php echo miaFunc ()?>
/ / You can write
?> <? MiaFunc = ()?>

More ...

Skypemote version of Adobe AIR

Install Adobe AIR Download Skypemote Version

This is the first release, 0.8 (aligned with the version online ), Editor of Skype Emotions - Skypemote - version of Adobe AIR . For now, the features are all the same version online , with the advantage of being a desktop application, then install Windows, Mac and Linux.
Before installation, remember to update and / or install for the first time, the runtime of Adobe AIR , if you have not already done so.

Download

You can download Air Skypemote from Google Code .

More ...

Actionscript 3.0 for beginners: lesson # 3

We continue the analysis of the example of the game Tic Tac Toe, presented in Actionscript 3.0 for beginners: lesson # 2 . We had arrived at the function that creates the game grid:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/ **
* Graphic design grid (3x3) on screen
*
* @ Param void
* @ Return void
* @ Private
* /
createGrid ( ) : void { private function createGrid (): void {
/ / Temporary pointer to a MovieClip
/ / Note: here you could also use a Sprite
/ / But in this case I need to extend the object
/ / Adding some personal proproetà. The Sprite
/ / Is a closed class and therefore not extensible runtime, while
/ / The MovieClip class is dynamic and therefore makes
/ / Possible the addition of runtime property
MovieClip , i : uint = 0 ; var tm: MovieClip , i: uint = 0;
/ / Add the MovieClip in a 3x3 pattern
; i < 9 ; i ++ ) { for (; i <9; i + +) {
( ) ; tm = new MovieClip ();
tm ) ; addChild (tm);
= OFFSETX + ( ( i % 3 ) * ( PLAYER_WIDTH + PLAYER_OFFSET ) ) tm. offsetX = x + ((i% 3) * (PLAYER_WIDTH PLAYER_OFFSET +))
= OFFSETY + Math . floor ( i / 3 ) * ( PLAYER_HEIGHT + PLAYER_OFFSET ) tm. OFFSETY + y = Math . floor (i / 3) * (+ PLAYER_HEIGHT PLAYER_OFFSET)
tm. _index = i;
0 ) ; drawPlayer (tm, 0);
}
/ / Draw the 2 lines and 2 horizontal veriticali
this . graphics ) { with (this. graphics) {
6 , 0x666666 ) ; lineStyle (6, 0x666666);
OFFSETX , OFFSETY + ( PLAYER_HEIGHT + 15 ) ) ; moveTo (offsetX, OFFSETY + (PLAYER_HEIGHT + 15));
OFFSETX + ( ( PLAYER_WIDTH + 20 ) * 3 ) , OFFSETY + ( PLAYER_HEIGHT + 15 ) ) ; lineTo (offsetX + ((PLAYER_WIDTH + 20) * 3), OFFSETY + (PLAYER_HEIGHT + 15));
OFFSETX , OFFSETY + ( PLAYER_HEIGHT + 20 ) * 2 ) ; moveTo (offsetX, OFFSETY + (PLAYER_HEIGHT + 20) * 2);
OFFSETX + ( ( PLAYER_WIDTH + 20 ) * 3 ) , OFFSETY + ( PLAYER_HEIGHT + 20 ) * 2 ) ; lineTo (offsetX + ((PLAYER_WIDTH + 20) * 3), OFFSETY + (PLAYER_HEIGHT + 20) * 2);
OFFSETX + ( PLAYER_WIDTH + 15 ) , OFFSETY ) ; moveTo (offsetX + (PLAYER_WIDTH + 15), OFFSETY);
OFFSETX + ( PLAYER_WIDTH + 15 ) , OFFSETY + ( ( PLAYER_HEIGHT + 20 ) * 3 ) ) ; lineTo (offsetX + (PLAYER_WIDTH + 15), OFFSETY + ((PLAYER_HEIGHT + 20) * 3));
OFFSETX + ( PLAYER_WIDTH + 20 ) * 2 , OFFSETY ) ; moveTo (offsetX + (PLAYER_WIDTH + 20) * 2 OFFSETY);
OFFSETX + ( PLAYER_WIDTH + 20 ) * 2 , OFFSETY + ( ( PLAYER_HEIGHT + 20 ) * 3 ) ) ; lineTo (offsetX + (PLAYER_WIDTH + 20) * 2 OFFSETY + ((PLAYER_HEIGHT + 20) * 3));
}
}

More ...



Stop SOPA