This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static bool CheckForInternetConnection() | |
| { | |
| try | |
| { | |
| using (var client = new WebClient()) | |
| using (var stream = client.OpenRead("http://www.google.com")) | |
| { | |
| return true; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Program { | |
| static void Main(string[]args) | |
| { | |
| ParallelLoop(); | |
| Console.ReadLine(); | |
| } | |
| public static void ParallelLoop() | |
| { | |
| var colors = new List{"red", "white", "blue", "green", "yellow","black"}; | |
| System.Threading.Tasks.Parallel.ForEach(colors, clr => Console.WriteLine(clr)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE MASTER | |
| GO | |
| CREATE PROCEDURE [dbo].[sp_LockDetail] | |
| AS | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Lanza un proceso con su ventana oculta y devuelve el resultado | |
| private static string lanzaProceso(string Proceso, string Parametros) | |
| { | |
| ProcessStartInfo startInfo = new ProcessStartInfo(Proceso, Parametros); | |
| startInfo.WindowStyle = ProcessWindowStyle.Hidden; | |
| startInfo.UseShellExecute = false; //No utiliza RunDLL32 para lanzarlo | |
| //Redirige las salidas y los errores | |
| startInfo.RedirectStandardOutput = true; | |
| startInfo.RedirectStandardError = true; | |
| Process proc = Process.Start(startInfo); //Ejecuta el proceso |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $("a[href='#top']").click(function() { | |
| $("html, body").animate({ scrollTop: 0 }, "slow"); | |
| return false; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.preloadImages = function() { | |
| for(var i = 0; i<arguments.length; i++) { | |
| $("<img />").attr("src", arguments[i]); | |
| } | |
| } | |
| $(document).ready(function() { | |
| $.preloadImages("hoverimage1.jpg","hoverimage2.jpg"); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var loading = false; | |
| $(window).scroll(function(){ | |
| if((($(window).scrollTop()+$(window).height())+250)>=$(document).height()){ | |
| if(loading == false){ | |
| loading = true; | |
| $('#loadingbar').css("display","block"); | |
| $.get("load.php?start="+$('#loaded_max').val(), function(loaded){ | |
| $('body').append(loaded); | |
| $('#loaded_max').val(parseInt($('#loaded_max').val())+50); | |
| $('#loadingbar').css("display","none"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MainActivity extends Activity { | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.layoutfab); | |
| //Outline | |
| int size = getResources().getDimensionPixelSize(R.dimen.fab_size); | |
| Outline outline = new Outline(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Execute the command Asynchronously. | |
| /// </summary> | |
| /// <param name="command">string command.</param> | |
| public void ExecuteCommandAsync(string command) | |
| { | |
| try | |
| { | |
| //Asynchronously start the Thread to process the Execute command request. | |
| Thread objThread = new Thread(new ParameterizedThreadStart(ExecuteCommandSync)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using DuoVia.FuzzyStrings; | |
| /// <summary> | |
| /// Busca el fichero con el nombre que mas se parece en la ruta elegida. | |
| /// Si no encuentra el fichero o carpeta devuelve Excepciones. | |
| /// Depende de DuoVia.FuzzyStrings | |
| /// </summary> | |
| /// <param name="path">Ruta donde buscar</param> | |
| /// <param name="filename">Nombre del fichero a buscar</param> | |
| /// <returns>Coincidencia mas exacta del fichero encontrado</returns> |
OlderNewer