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
//nota: limpiar la busqueda | |
edt_search.setQuery("", false); | |
edt_search.clearFocus(); |
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
@app.route('/img/<int:codigo>') | |
def img(codigo=0): | |
from base64 import b64encode | |
import io | |
data = getcon().execute('select IMAG_OBJETO from farma.IMAGENES where IMAG_CODIGO = :imag_codigo', imag_codigo=codigo).fetchone() | |
info = data.imag_objeto | |
from flask import send_file | |
return send_file(io.BytesIO(info), mimetype='image/jpg') |
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 static void uninstallApp(Context context,String packageName){ | |
Intent intent = new Intent(Intent.ACTION_DELETE); | |
intent.setData(Uri.parse(packageName)); | |
context.startActivity(intent); | |
} | |
public static void installApp(Context context, String filePath){ | |
Intent intent = new Intent(Intent.ACTION_VIEW); | |
intent.setDataAndType(Uri.parse(filePath), "application/vnd.android.package-archive"); | |
context.startActivity(intent); |
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
// jsonarray response: [{"appname":"wt_compras","version":"2.0.0","url":"wt_compras.apk"}, {"appname":"OperacionesMobiles","version":"2.0.0","url":"OperacionesMobiles.apk"}, {"appname":"Cargar Cantidad Hallada","version":"2.0.0","url":"Cargar Cantidad Hallada.apk"}, {"appname":"WT Picking","version":"2.0.0","url":"WT Picking.apk"}, {"appname":"Empaques","version":"2.0.0","url":"Empaques.apk"}, {"appname":"Dimensiones","version":"2.0.0","url":"Dimensiones.apk"}, {"appname":"wtpicking","version":"2.0.0","url":"wtpicking.apk"}] | |
Gson gson = new Gson(); | |
Type type = new TypeToken<List<AppEntity>>(){}.getType(); | |
List<AppEntity> list = gson.fromJson(response.getJSONArray("files").toString(), type); | |
for (AppEntity app : list){ | |
Log.e(TAG, "test: " + app.getAppname() + " " + app.getVersion() ); | |
} |
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 static void setActionBarUser(android.support.v7.app.ActionBar actionBar, String user){ | |
try { | |
actionBar.setSubtitle(String.format(Locale.US, "Usuario: %s", user)); | |
}catch (Exception e){ | |
actionBar.setSubtitle(""); | |
e.printStackTrace(); | |
} | |
} | |
public static void setActionBarMessage(android.support.v7.app.ActionBar actionBar, String message) { |
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
DECLARE | |
al_id Alert := Find_Alert('ALERT15'); | |
al_button NUMBER; | |
WTOTAL NUMBER; | |
FileHandle1 WIN_API.FILE_TYPE; | |
FileName1 VARCHAR2(400) := 'C:\xxxx.DAT'; | |
FileMode1 VARCHAR2(30) := 'W'; | |
RaiseExceptions1 BOOLEAN := FALSE; | |
Wokudum1 boolean; | |
DataBuffer1 VARCHAR2(400); |
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
@app.context_processor | |
def inject_functions(): | |
return dict(date=datetime.date.today().strftime("%d/%m/%Y")) |
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 static void activarBluetooth(boolean value) { | |
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); | |
if (value) { | |
if (!bluetoothAdapter.isEnabled()) { | |
bluetoothAdapter.enable(); | |
} | |
}else{ | |
if (bluetoothAdapter.isEnabled()){ | |
bluetoothAdapter.disable(); | |
} |
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
>>> datetime.strptime(cr_date, '%Y-%m-%d %H:%M:%S.%f') | |
datetime.datetime(2013, 10, 31, 18, 23, 29, 227) | |
>>> datetime.strptime(cr_date, '%Y-%m-%d %H:%M:%S.%f').strftime('%m/%d/%Y') | |
'10/31/2013' |
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
# Archivo de configuracion de entornos | |
import os | |
class Config(object): | |
DEBUG = False | |
TESTING = False | |
SECRET_KEY = os.urandom(9990999) | |
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif', 'fbk'} | |
JINJA_ENV_CACHE = None | |
TRIM_BLOCKS = True |