CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Java
ListAdapter adapter = new SimpleAdapter(this, resultlist,
      R.layout.list_item, new String[] { TAG_TITLE, TAG_ARTIST,
            TAG_ALBUM },
      new int[] { R.id.title, R.id.artist, R.id.album});
 
setListAdapter(adapter);
by laabroo   Friday @ 10:28pm
Tags: java
7 Views
no comments
 
ListAdapter adapter = new SimpleAdapter(this, resultlist,
      R.layout.list_item, new String[] { TAG_TITLE, TAG_ARTIST,
            TAG_ALBUM, TAG_ALAMAT },
      new int[] { R.id.title, R.id.artist, R.id.album, R.id.alamat });
 
setListAdapter(adapter);
by laabroo   Friday @ 10:26pm
Tags: java
8 Views
no comments
 
ListView lv = getListView();
 
        // Launching new screen on Selecting Single ListItem
        lv.setOnItemClickListener(new OnItemClickListener() {
 
            public void onItemClick(AdapterView<?> parent, View view,
                    int position, long id) {
                // getting values from selected ListItem
                @SuppressWarnings("unchecked")
                HasMap<String,String> obj = (HasMap<String,String>)lv.getItemAtPosition(position);
by laabroo   Friday @ 10:22pm
Tags: java
8 Views
no comments
 
//******************************//
//Prevent wrong input for mobile
//******************************//
 $("#Mobile").keydown(function (event) 
{
    // Allow: backspace, delete, tab and escape
    if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 ||
    // Allow: Ctrl+A
    (event.keyCode == 65 && event.ctrlKey === true) ||
    // Allow: home, end, left, right
by Egli   May 14, 2012 @ 11:43pm
10 Views
no comments
 
var baseUrl;
var applicationUrl;
 
baseUrl = document.location.href;
baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/'));
applicationUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/'));
by Warren Wiltshire   May 02, 2012 @ 5:24am
17 Views
no comments
 
//start processing
var api = new moviesApi();
api.getRatings({
    success: function (result) {
        for (var i = 0; i < result.length; i++) {
            //new Option(text, value)
            var option = new Option(result[i].ID, result[i].Name);
            $('#ratings').append(
                $('<option></option>').val(result[i].ID).html(result[i].Name)
            );
22 Views
no comments
 
displayError = function (result) {
    $('#errorDisplay').show();
    $('#errorDisplay').html(result.responseText);
}
by Warren Wiltshire   May 02, 2012 @ 5:20am
31 Views
no comments
 
<%@ Page Title="" Language="C#" MasterPageFile="~/Miso1.Master" AutoEventWireup="true" CodeBehind="Currency.aspx.cs" Inherits="WebApplication1.Currency" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
    <script type="text/javascript" language="javascript">
 
        $(document).ready(function () {
        });
 
 
        String.prototype.replaceAll = function (str1, str2, ignore) {
            return this.replace(new RegExp(str1.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g, "\\$&"), (ignore ? "gi" : "g")), (typeof (str2) == "string") ? str2.replace(/\$/g, "$$$$") : str2);
by Fred Peters   April 03, 2012 @ 6:44am
46 Views
no comments
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
 
        <script type="text/javascript" src="JavaScript/jquery-1.4.1.min.js"></script>
        
        <script type="text/javascript" language="javascript">
 
        String.prototype.replaceAll = function (str1, str2, ignore) {
by Fred Peters   April 03, 2012 @ 6:42am
33 Views
no comments
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
 
        <script type="text/javascript" src="JavaScript/jquery-1.4.1.min.js"></script>
        
        <script type="text/javascript" language="javascript">
 
        String.prototype.replaceAll = function (str1, str2, ignore) {
by Fred Peters   March 30, 2012 @ 11:00am
39 Views
no comments
 
 ajaxCallMethod("CallbackHandler.ashx?", "Test",
             [{ Entered: "03/15/2010", Name: "Rick"}],
             function (result) {
                 alert(result);
             });
ajaxCallMethod("CallbackHandler.ashx?", "Test",
             [{ Entered: new Date(2010,2,15), Name: "Rick"}],
             function (result) {
                 alert(result);
             });
by Rick Strahl   March 19, 2012 @ 2:10pm
57 Views
no comments
 
C#
using System;
using System.Net.Http.Formatting;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Json;
using System.IO;
 
namespace Westwind.Web.WebApi
{
    public class JavaScriptSerializerFormatter : MediaTypeFormatter
by Rick Strahl   March 08, 2012 @ 5:17pm
386 Views
no comments
 
/*IDE Shortcuts */
//Finds a type inside a class
Ctr + Shift + T
 
//Finds a resource inside a class
Ctr + Shift + R
 
//Search for methods or variables inside a class
Ctr + O
 
by Egli   February 13, 2012 @ 8:15pm
47 Views
no comments
 
function IsPageValid() 
{
    var validated = Page_ClientValidate('UserComments');
 
    if (validated) 
    {
        //Its valid
        return true;
    }
    else 
by Egli   February 09, 2012 @ 4:04pm
69 Views
no comments
 
$(document).ready(function () {
    if (window.location.protocol == 'https:') {
        $("a[href^='http:\/\/" + window.location.hostname + "']").each(function() { 
               this.href = this.href.replace(/^http:/i, "https:");
           });
    };
});
by Javier Callico   January 24, 2012 @ 7:27am
46 Views
no comments
 
<script type="text/javascript">
 
    function CustomValidatorOmbudsmanNotifiedDate(s, args) {
        var dt = args.Value
 
        if (!dt && $("*[id$='OmbudsmanNotifiedFlag'] input:checked").val() == '1') {
            args.IsValid = false;
        }
        else {
            args.IsValid = true;
by Cat   December 12, 2011 @ 3:27pm
85 Views
no comments
 
public String httpResponseAsString(InputStream is, String charset) throws IOException{
        if(is==null){
            return "";
        }
        
        StringBuffer out=new StringBuffer();
        String line ;
        try {
            BufferedReader reader=new BufferedReader(new InputStreamReader(is, charset));
            while ((line=reader.readLine())!=null) {
by x03570227   November 28, 2011 @ 12:16am
53 Views
no comments
 
/*
@ Navigator Detect Function (JavaScript)
@author Luca Provenzano (mailto: hiimluca@gmail.com)
*/
 
function NavDetect(Navegador){
        var Navegador = navigator.appName;
        switch(Navegador){
            case 'Netscape':
            alert('Usted está utilizando Mozilla Firefox o Chrome');
111 Views
no comments
 
/*
@Function NumToBase();
@Exercise JS developed by Luca Provenzano
*/
 
function NumToBase(num, base, prefijo, sufijo){
                var Conversion;
                if (typeof base == 'undefined') base = 16;
                if (typeof prefijo == 'undefined') prefijo = '0x';
                if (typeof sufijo == 'undefined') sufijo = '';
by Luca Provenzano   September 13, 2011 @ 2:58pm
92 Views
no comments
 
<!DOCTYPE html>
<html lang="es">
<head>
    <title>Problema de Física en JS</title>
        <script type="text/javascript">
            //Problema a resolver
            document.write('<p>Sobre un cuerpo de 36 kg que se encuentra en reposo, se aplica una fuerza durante 7 segundos hasta que alcance una velocidad de 21 m/s. <br /> Calcular: <ol><li>Aceleración</li><li>Espacio</li><li>Fuerza aplicada</li><li>Peso</li></ol></p>');
            
            //Datos iniciales a tener en cuenta
            var vi = 0; //Velocidad inicial
143 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate