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
| import os | |
| PATH = path/to/my/blueprints/directory | |
| BLUEPRINT = 'the_blueprint' | |
| def import_file(path, name=None): | |
| """ imports a file with given name and path """ | |
| # use the imp module to do actual imports | |
| import imp | |
| name = name or os.path.split(path)[-1].replace(".", "_") |
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
| procedure TForm1.Table1CategoryGetText(Sender: TField; | |
| var Text: String; DisplayText: Boolean); | |
| begin | |
| case Sender.AsInteger of | |
| 1: Text := 'Electrical'; | |
| 2: Text := 'Agricultural'; | |
| else | |
| Text := '[Error]'; | |
| end; | |
| end; |
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
| buildTypes { | |
| release { | |
| minifyEnabled true | |
| proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
| signingConfig signingConfigs.config | |
| applicationVariants.all { variant -> | |
| variant.outputs.each { output -> | |
| project.ext { appName = 'whpicking' } | |
| def formattedDate = "-" + variant.versionName + "_" + variant.versionCode + "-" + new Date().format('yyyyMMddHHmmss') | |
| def newName = output.outputFile.name |
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
| sudo apt-get -o Acquire::http::Proxy="http://user:passwort@proxy:port" update/upgrade |
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
| @app.template_filter('ffloat') | |
| def _jinta2_filter_numer(number): | |
| # return "8.,1f".format(float(number)) | |
| import locale | |
| locale.setlocale(locale.LC_ALL, app.config['LOCALE']) | |
| return locale.format('%.2f', number, grouping=True) | |
| @app.template_filter('fnumber') | |
| def do_fnumber(value): |
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
| @NonNull | |
| @Override | |
| public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { | |
| View view = convertView; | |
| if (view == null){ | |
| view = View.inflate(getContext(), R.layout.layout_app_item, null); | |
| } | |
| ResolveInfo info = getItem(position); | |
| Drawable icon = getContext().getResources().getDrawable(android.R.drawable.sym_def_app_icon); |
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
| package py.com.puntofarma; | |
| import org.apache.log4j.Logger; | |
| import org.springframework.boot.devtools.filewatch.ChangedFiles; | |
| import org.springframework.boot.devtools.filewatch.FileChangeListener; | |
| import org.springframework.boot.devtools.filewatch.FileSystemWatcher; | |
| import org.springframework.stereotype.Component; | |
| import java.io.File; | |
| import java.nio.file.Watchable; |
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
| ps.setDate(5, new java.sql.Date(m.getMoin_fch_vencimiento().getTime())); |
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
| #Coneccion a base de datos oracle | |
| import os | |
| import cx_Oracle | |
| #Config | |
| params = {'host':'127.0.0.1','port':1521, 'database':'prod'} | |
| settings = {'username':'user', 'userpass':'masterkey'} | |
| #Crear conexion | |
| tns = cx_Oracle.makedsn(params.host, params.port, params.database) |
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
| /** | |
| * Utilidad para mostrar la captura de exceptions del sistema | |
| * @param context | |
| * @param message | |
| */ | |
| public static void ShowException(@NonNull Context context, @NonNull String message) { | |
| Drawable icon = context.getResources().getDrawable(android.R.drawable.ic_dialog_alert); | |
| icon.setColorFilter(Color.RED, PorterDuff.Mode.MULTIPLY); | |
| AlertDialog.Builder dlg = new AlertDialog.Builder(context); | |
| dlg.setIcon(icon); |