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
/* | |
* Copyright (C) 2015, Scott Alexander-Bown, Daniel Abraham | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 boolean isFirstInstall() { | |
try { | |
long firstInstallTime = App.getContext().getPackageManager().getPackageInfo(getPackageName(), 0).firstInstallTime; | |
long lastUpdateTime = App.getContext().getPackageManager().getPackageInfo(getPackageName(), 0).lastUpdateTime; | |
return firstInstallTime == lastUpdateTime; | |
} catch (PackageManager.NameNotFoundException e) { | |
e.printStackTrace(); | |
return false; | |
} | |
} |
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
To upgrade/install jhipster | |
------------------------------ | |
delete the local node_modules in your project folder | |
do npm i generator-jhipster -g | |
do npm i generator-jhipster-entity-audit -g | |
run npm i in the project folder |
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
//var date: Calendar? = null | |
fun rescheduleInstallation() { | |
val currentDate = Calendar.getInstance() | |
val date = Calendar.getInstance() | |
DatePickerDialog(this, object : DatePickerDialog.OnDateSetListener { | |
override fun onDateSet(view: DatePicker, year: Int, monthOfYear: Int, dayOfMonth: Int) { | |
date?.set(year, monthOfYear, dayOfMonth) | |
TimePickerDialog(this@InstallationDetailActivity, TimePickerDialog.OnTimeSetListener { view, hourOfDay, minute -> | |
date?.set(Calendar.HOUR_OF_DAY, hourOfDay) | |
date?.set(Calendar.MINUTE, minute) |
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
Criteria criteria = new Criteria().andOperator( | |
where("warehouse").is(warehouse), | |
where("date").gte(currentYear.getStart()), | |
where("date").lte(currentYear.getEnd()) | |
); | |
ProjectionOperation dateProjection = project() | |
.and("amount").as("amount") | |
.and("date").extractYear().as("year") | |
.and("date").extractMonth().as("month"); |
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 final FIVE_SECONDS = 5000; | |
public void scheduleSendLocation() { | |
handler.postDelayed(new Runnable() { | |
public void run() { | |
sendLocation(); // this method will contain your almost-finished HTTP calls | |
handler.postDelayed(this, FIVE_SECONDS); | |
} | |
}, FIVE_SECONDS); | |
} |
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
SELECT r.* | |
FROM region r, vehicleparameters vp, vehicle v | |
WHERE r.region = vp.REGION_ID and v.id = vp.VEHICLE_ID |
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
UPDATE vehicleparameters vp | |
SET vp.REGION_ID = 71003331 WHERE vp.VEHICLE_ID = | |
( | |
SELECT v.ID | |
FROM vehicle v | |
WHERE v.registrationno = 'BDG 384 AU' | |
); | |
UPDATE vehicleparameters vp | |
SET vp.REGION_ID = 71003331 WHERE vp.VEHICLE_ID = |
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
http://197.210.2.132/galooliDevKitService/galooliDevKitService.svc/json/GetDailyInformation?userName=progserver&userHost=mtnn-business&userOrg=zon_mtnn_business&password=sattrak&requestedUnits=1116440&startDate=2017-01-01&endDate=2017-01-16&requestedPropertiesStr=date,unit_id,unit_name,fuel_init,fuel_final |
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
... | |
@Inject | |
BookRepository bookRepository; | |
/** | |
* DELETE /books/:id : delete the "id" book. | |
* | |
* @param books the id of the book to delete | |
* @return the ResponseEntity with status 200 (OK) | |
*/ |