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
VK_NONE: EQU $00 ; No character (marks the first virtual key) | |
VK_SPACE: EQU $01 ; Space | |
VK_0: EQU $02 ; Number 0 | |
VK_1: EQU $03 ; Number 1 | |
VK_2: EQU $04 ; Number 2 | |
VK_3: EQU $05 ; Number 3 | |
VK_4: EQU $06 ; Number 4 | |
VK_5: EQU $07 ; Number 5 |
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
andymccall@earth:~/$ pacmd list-cards | |
3 card(s) available. | |
index: 0 | |
name: <alsa_card.pci-0000_01_00.1> | |
driver: <module-alsa-card.c> | |
owner module: 7 | |
properties: | |
alsa.card = "1" | |
alsa.card_name = "HDA NVidia" | |
alsa.long_card_name = "HDA NVidia at 0xdf080000 irq 17" |
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
# Stop PostgreSQL from auto starting | |
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist | |
# Enable PostgreSQL to auto start | |
sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist | |
# Start postgres | |
$ sudo su postgres | |
Password: | |
bash-3.2$ pg_ctl -D /Library/PostgreSQL/9.3/data/ start |
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
Application | |
=========== | |
@SpringBootApplication | |
public class Application { | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); // never coverered! | |
} |
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
<option th:each="authority : ${authoritiesList}" | |
th:value="${authority.LocalAuthorityId}" | |
th:text="${authority.Name}" | |
th:if="${authority.LocalAuthorityId == localAuthorityId}" th:selected="selected"> | |
</option> |
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
public class Main { | |
public static void main(String[] args) { | |
int numberOfPosts = 45; | |
int pageSize = 3; | |
int numberOfPages = numberOfPosts / pageSize; | |
int lastPage = 0; | |
int firstPage = 0; |
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
System.out.println(startDate + "-" + endDate); | |
============================================== | |
Sun Jan 01 00:00:00 GMT 2017-Sun Dec 31 23:59:59 GMT 2017 | |
Hibernate | |
========= |
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 co.twibble.model; | |
import org.springframework.format.annotation.DateTimeFormat; | |
import javax.persistence.*; | |
import java.util.Date; | |
/** | |
* The Post class is the class that holds blog posts | |
* |
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
public List<Post> getPostByYear(int year) { | |
List<Post> posts = new ArrayList<>(); | |
try { | |
Query query; | |
Date startDate; | |
Date endDate; | |
startDate = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH).parse(year + "-" + 01 + "-" + 01); |