Skip to content

Instantly share code, notes, and snippets.

View chukitow's full-sized avatar

Ivan velasquez chukitow

View GitHub Profile
@chukitow
chukitow / LOGIN ANDROID
Created January 9, 2014 16:56
this is a login in android using HTTP,POST,JSON
package com.example.situc;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
@chukitow
chukitow / ArrayAdapter
Created January 16, 2014 05:32
ArrayAdapter using to populate a LISTVIEW
package com.example.listactivitycustom;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
View rowView = convertView;
Alumno alumno = getItem(position);
AlumnoWrapper wrapper;
if(rowView == null)
{
LayoutInflater inflater = context.getLayoutInflater();
$.ajax({
xhr: function()
{
var xhr = new window.XMLHttpRequest();
//Upload progress
xhr.upload.addEventListener("progress", function(evt){
if (evt.lengthComputable) {
var percentComplete = evt.loaded / evt.total;
//Do something with upload progress
console.log(percentComplete);
/ Create a formdata object and add the files
var data = new FormData();
$.each(files, function(key, value)
{
data.append(key, value);
});
$file_name = $_FILES['files']['name'];
$config['upload_path'] ='img/';
$config['allowed_types'] = 'gif|jpg|png|mp3|pdf|rar|zip';
$config['max_size'] = '0';
$config['max_width'] = '0';
$config['max_height'] = '0';
$config['overwrite'] = true;
$config['file_name'] = $file_name;
$this->load->library('upload',$config);
;**********************************************************************
; This file is a basic code template for assembly code generation *
; on the PIC16F877A. This file contains the basic code *
; building blocks to build upon. *
; *
; Refer to the MPASM User's Guide for additional information on *
; features of the assembler (Document DS33014). *
; *
; Refer to the respective PIC data sheet for additional *
; information on the instruction set. *
$config['full_tag_open'] = '<div class="pagination"><ul>';
$config['full_tag_close'] = '</ul></div><!--pagination-->';
$config['first_link'] = '&laquo; Inicio';
$config['first_tag_open'] = '<li class="prev page">';
$config['first_tag_close'] = '</li>';
$config['last_link'] = 'Fin &raquo;';
$config['last_tag_open'] = '<li class="next page">';
$config['last_tag_close'] = '</li>';
#include <18f4520.h>
#device adc = 10
#fuses XT, PUT, NODEBUG , NOBROWNOUT , NOPROTECT , NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, bits = 8 , parity = N ,xmit=PIN_C6,rcv=PIN_C7)
int16 resolucion1 = 10; //Variable para la resolucion, inicial 10
int16 resolucion2 = 10;
int contadorEnviar = 1; //Contador auxiliar para enviar informacion cada segundo
#include <18f4520.h>
#fuses XT, NOWDT, PUT, NODEBUG, NOBROWNOUT, NOPROTECT, NOLVP, NOWRT
#use delay(clock=4000000)
boolean timerDetected = false;
int general = 0;
#INT_TIMER0
void timer()