Monday, May 24, 2010

SyntaxHighlighter on Web & Blogger

1. Download the latest version
2. Unrar to a temp folder. ex: c:\temp\syntaxhighlighter
3. Transfer the folders (Scripts and Styles) to a web server. I use google code to host my files.
4. Open blogger.com and sign in.
5. Goto "Template" and choose "Classic" layout.
6. Goto Edit Html.
7. After <head> insert the following:

<link href="http://mortenlyhr.googlecode.com/svn/trunk/SyntaxHighlighter/Styles/SyntaxHighlighter.css" type="text/css" rel="stylesheet" /> </link>
<script language="javascript" src="http://mortenlyhr.googlecode.com/svn/trunk/SyntaxHighlighter/Scripts/shCore.js"></script>
<script language="javascript" src="http://mortenlyhr.googlecode.com/svn/trunk/SyntaxHighlighter/Scripts/shBrushCSharp.js"></script>
<script language="javascript" src="http://mortenlyhr.googlecode.com/svn/trunk/SyntaxHighlighter/Scripts/shBrushXml.js"></script>
<script language="javascript" src="http://mortenlyhr.googlecode.com/svn/trunk/SyntaxHighlighter/Scripts/shBrushCss.js"></script>
<script language="javascript" src="http://mortenlyhr.googlecode.com/svn/trunk/SyntaxHighlighter/Scripts/shBrushJScript.js"></script>
<script language="javascript" src="http://mortenlyhr.googlecode.com/svn/trunk/SyntaxHighlighter/Scripts/shBrushSql.js"></script>

8. And before </body> insert:

<script language="javascript">
dp.SyntaxHighlighter.ClipboardSwf = 'http://mortenlyhr.googlecode.com/svn/trunk/SyntaxHighlighter/Scripts/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
</script>

or
<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>

Fuente:
http://morten.lyhr.dk/2007/12/how-to-get-syntax-highlighting-in.html
http://code.google.com/p/syntaxhighlighter/w/list
for Blogger
http://yacoding.blogspot.com/2008/05/how-to-add-syntax-highlight-to-blogger.html

C# Resize image


public void ResizeImage(string OriginalFile, string NewFile, int NewWidth, int MaxHeight, bool OnlyResizeIfWider)
{
System.Drawing.Image FullsizeImage = System.Drawing.Image.FromFile(OriginalFile);

// Prevent using images internal thumbnail
FullsizeImage.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);
FullsizeImage.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);

if (OnlyResizeIfWider)
{
if (FullsizeImage.Width <= NewWidth)
{
NewWidth = FullsizeImage.Width;
}
}

int NewHeight = FullsizeImage.Height * NewWidth / FullsizeImage.Width;
if (NewHeight > MaxHeight)
{
// Resize with height instead
NewWidth = FullsizeImage.Width * MaxHeight / FullsizeImage.Height;
NewHeight = MaxHeight;
}

System.Drawing.Image NewImage = FullsizeImage.GetThumbnailImage(NewWidth, NewHeight, null, IntPtr.Zero);

// Clear handle to original file so that we can overwrite it if necessary
FullsizeImage.Dispose();

// Save resized picture
NewImage.Save(NewFile);
}


Resources
=========
C#: Resize An Image While Maintaining Aspect Ratio and Maximum Height

http://www.switchonthecode.com/tutorials/csharp-tutorial-image-editing-saving-cropping-and-resizing

Sunday, May 23, 2010

Encriptar/Desencriptar texto

http://online.arredemo.org/codificar/

Lugares interesantes

Correo anonimo
http://superpatanegra.com/correoanonimo/index.php
Invertir teto
http://generadores.arredemo.org/girartexto/
flv player
http://superpatanegra.com/banners/index-video.php
http://superpatanegra.com/textoaimagen/image.php
email a imagen
http://superpatanegra.com/email/

Saturday, May 22, 2010

Recovery Password

http://mediakey.dk/~cc/howto-how-to-reset-the-mysql-root-password/

Targetas de crédito

Bancos
http://en.wikipedia.org/wiki/List_of_Bank_Identification_Numbers

Generador de números de targeta de crédito validas aleatorias
http://mediakey.dk/~cc/wp-dyn/credit-card-number-generator.php

http://www.darkcoding.net/credit-card-generator/

Genera codigo vv2
http://www.xonico.com.ar/index.php?s=CodigoCC

http://generadores.arredemo.org/ccgenerador/

Thursday, May 20, 2010

Great design and scripts

http://www.cssplay.co.uk/menus/
http://blogvecindad.com/lista-completa-de-menus-con-css-para-diseandores-web/2007/06/05
http://www.dynamicdrive.com/dynamicindex1/omnislide/index.htm
http://www.javascriptkit.com/script/cutindex16.shtml
http://www.creativeprogramming.it/blogs/wp/index.php/2009/08/19/gwt-ext-how-to-programmatically-swap-themes/#tb
http://www.daniweb.com/forums/thread127263.html

JavaScript Resources

http://www.dynamicdrive.com/dynamicindex16/
http://www.givainc.com/labs/mcdropdown_jquery_plugin.htm
http://www.quizzpot.com/2009/10/combo-box-loaded-dynamically-and-remotely/

Tuesday, May 18, 2010

Erotic pictures gallery

This summary is not available. Please click here to view the post.

Friday, May 14, 2010

Restaurando VS2008

Si perdiste tus templates los puedes restaurar asi

>devenv /ResetSettings
En mi caso fue asi.
>C:\Archivos de programa\Microsoft Visual Studio 9.0\Common7\IDE>devenv /resetset
tings

Ayuda ASP.NET MVC2

http://feeds.feedburner.com/climens_aspnetmvc

NHibernate

NHibernate y localización
http://codelog.climens.net/2010/03/16/nhibernate-y-localizacion/

Thursday, May 13, 2010

jQuery para iframe

http://huuah.com/jquery-and-iframe-manipulation/

Trabajando con Delegados en C#

Codigo 1
==========================================
public delegate void DelegateType(string message);


Codigo 2
==========================================

public static void Method(string message)
{
System.Console.WriteLine(message);
}

Función cualquiera con la misma firma que DelegateType es decir void xxx(string yyy)

Codigo 3
==========================================

DelegateType handler = Method; //Esto es posible xq DelegateType es una referencia
//a funciones con la firma void xxx(string yyy).

handler("Hello World"); //Llama a Method

Codigo 4
==========================================

public void MethodWithCallback(int param1, int param2, DelegateType callback)
{
callback("The number is: " + (param1 + param2).ToString());
}


Codigo 5
==========================================
MethodWithCallback(1, 2, handler); //Llamada enviando una referencia a Method

Codigo 6
==========================================
public void Method1(string message) { }
public void Method2(string message) { }

DelegateType d1 = Method1;
DelegateType d2 = Method2;
DelegateType d3 = Method;
DelegateType allMethodsDelegate = d1 + d2;//assigna referencia a d1 y d2
allMethodsDelegate += d3; //agrega referencia a una tercera funcion


Codigo 8
==========================================
allMethodsDelegate -= d1; //elimina d1 de la lista de referencias
DelegateType oneMethodDelegate = allMethodsDelegate - d2; //Copia todos menos d2

Codigo 9
==========================================
int invocationCount = d1.GetInvocationList().GetLength(0); //Cantidad de referencias

Codigo 10
==========================================


using System.Reflection;

namespace DemoDelegate
{
public delegate void D();

public class ComprobaciónDelegados

{

public static void Main()
{

Type t = typeof(ComprobaciónDelegados);
MethodInfo m = t.GetMethod("Metodo1");
D obj = (D) Delegate.CreateDelegate(typeof(D), m);
obj();
}



public static void Metodo1()

{ Console.WriteLine("Ejecutado Método1"); }



public static void Metodo2(string s)

{ Console.WriteLine("Ejecutado Método2");
}

}
}

Wednesday, May 05, 2010

Music Online

[1] HQ mp3 https://hayqbhgr.slider.kz   #2023

[2] http://entuflow.net/Cumbia-Mexicana/

Ubuntu Forware port 80

  #!/bin/bash iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8069 iptables -t nat -A PREROUTING -i eth0 -p tc...