This file contains 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
#!flask/bin/python | |
from flask import Flask, jsonify, abort, request, make_response, url_for | |
from flask.ext.httpauth import HTTPBasicAuth | |
app = Flask(__name__, static_url_path = "") | |
auth = HTTPBasicAuth() | |
@auth.get_password | |
def get_password(username): | |
if username == 'miguel': |
This file contains 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
Toast msg = new Toast(getActivity()); | |
View v = View.inflate(getActivity(), R.layout.dlg_save, null); | |
msg.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL,0,0); | |
msg.setView(v); | |
msg.show(); |
This file contains 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
private void msg(String message) { | |
Toast msg = new Toast(getActivity()); | |
View v = View.inflate(getActivity(), R.layout.dlg_save, null); | |
TextView t = (TextView) v.findViewById(R.id.lbldlgsuccess); | |
t.setText(message); | |
msg.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL,0,0); | |
msg.setView(v); | |
msg.show(); | |
} |
This file contains 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
String url = "http://app.data.com/test"; | |
Log.w("getSucursales", "Sucursales: "); | |
pb_sucursales.setVisibility(View.VISIBLE); | |
$.getJSON(url, null, new Function() { | |
@Override | |
public void invoke($ $, Object... objects) { | |
String valor = objects[0].toString(); | |
List<Sucursal> sucs = new Gson().fromJson(valor, new TypeToken<List<Sucursal>>() { | |
}.getType()); | |
lst_sucursales = new SucursalesAdapter(getActivity(), R.layout.layout_suc_item, sucs); |
This file contains 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 interface DeliverUserMapper{ | |
@Results(id = "DeliverUserResults", value = { | |
@Result(property = "usuario", column = "DLRY_USUARIO", id = true), | |
@Result(property = "fecha", column = "DLRY_FECHA"), | |
@Result(property = "estado", column = "DLRY_ESTADO"), | |
@Result(property = "dispositivo", column = "DLRY_DISPOSITIVO"), | |
@Result(property = "observacion", column = "DLRY_OBSERVACION") | |
}) |
This file contains 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 void setDeliverStatus(String username, String status) { | |
try (SqlSession session = getSqlSessionFactory().openSession()) { | |
DeliverUserMapper mapper = session.getMapper(DeliverUserMapper.class); | |
mapper.setDeliverStatus(username, status); | |
session.commit(); | |
} | |
} |
This file contains 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
//mensaje de error | |
SnackBarItem.Builder b = new SnackBarItem.Builder(getActivity()); | |
b.setMessage(getString(R.string.str_credenciales_invalidas)); | |
b.setSnackBarBackgroundColor(getResources().getColor(R.color.danger_dark)); | |
b.setActionMessageColor(Color.WHITE); | |
b.show(); |
This file contains 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
/** | |
* Created by dario on 20/02/17. | |
*/ | |
$(function ($, window) { | |
$.fn.tabla = function () { | |
var currentPage = 0; | |
var numPerPage = 10; | |
var $table = $(this); | |
/*repaginado de la tabla*/ |
This file contains 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
from bs4 import BeautifulSoup | |
import requests | |
url = 'https://www.visionbanco.com/personas/servicios/mesa-de-cambios' | |
f = requests.get(url) | |
soup = BeautifulSoup(f.content, 'html.parser') | |
for item in soup.find_all('tr'): | |
for p in item.find_all('p'): | |
print p.text |
This file contains 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
package py.com.puntofarma.deliverytracker30.services; | |
import android.app.Service; | |
import android.content.Intent; | |
import android.location.Location; | |
import android.os.Bundle; | |
import android.os.IBinder; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.util.Log; |
OlderNewer