id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
f0593d6e-f981-4344-a76b-1fe03b10854c | public String getImageUrl() {
return imageUrl;
} |
96c624bd-9570-4847-b394-8d485cd172bc | public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
} |
a25293bd-cd73-42b1-8c45-da5822708c8d | public boolean getIsOut() {
return isOut;
} |
280bb09a-6f93-4083-bf81-cbd531d320a7 | public void setIsOut(boolean isOut) {
this.isOut = isOut;
} |
cc2d3325-2d29-4c68-b9f2-f20ec4ffb5db | public String getMpaaRating() {
return mpaaRating;
} |
e7883704-05d2-4863-b435-7ebdef6c7a87 | public void setMpaaRating(String mpaaRating) {
this.mpaaRating = mpaaRating;
} |
b2775506-2ee8-441c-a5c4-9b8f3ff05e93 | public String getPlatform() {
return platform;
} |
576b7446-2017-4cc6-9e4a-c69be27e957f | public void setPlatform(String platform) {
this.platform = platform;
} |
1ec2c024-b856-4b97-a988-76d4e8043436 | public int getReferenceNumber() {
return referenceNumber;
} |
6c301c02-412e-4474-b456-711bc893538d | public void setReferenceNumber(int referenceNumber) {
this.referenceNumber = referenceNumber;
} |
74f573e9-0a4b-476a-bfcc-76f6fc8753d5 | public int getReleaseYear() {
return releaseYear;
} |
c3aa6dc4-99f5-45fe-8b2b-f3349c40b3e7 | public void setReleaseYear(int releaseYear) {
this.releaseYear = releaseYear;
} |
1ff09b9b-2a64-49ee-b038-3199253bd7ae | public String getSynopsis() {
return synopsis;
} |
4602e131-5b72-4d17-a7fe-1f3288990a7b | public void setSynopsis(String synopsis) {
this.synopsis = synopsis;
} |
4a82e3a8-0718-4480-9c2f-dc6aca3c4da7 | public String getTitle() {
return title;
} |
27504f91-3d61-4c66-b1c5-6e164ef27938 | public void setTitle(String title) {
this.title = title;
} |
c6932ee3-ff38-4ca6-a527-d77506e0456b | public String getTrailerUrl() {
return trailerUrl;
} |
7495277f-750e-4a01-8528-562819330d76 | public void setTrailerUrl(String trailerUrl) {
this.trailerUrl = trailerUrl;
} |
95129250-3aa6-40af-b86c-0c417ad4a1b4 | public String getType() {
return type;
} |
99aea5d7-c114-47ca-998b-75053c2d4ca1 | public void setType(String type) {
this.type = type;
} |
f5ebd4e2-4b8a-4d52-b8d9-d8534352f050 | public int getUserRating() {
return userRating;
} |
6821af30-8afe-4d4b-9568-96a3830ea22e | public void setUserRating(int userRating) {
this.userRating = userRating;
} |
6ad60189-086f-4fbc-a7fe-82c4bba9f309 | public Set<BundleEntity> getBundleEntities() {
return bundleEntities;
} |
ad0cfc79-522d-470f-be2f-a63d5f876e9f | public void setBundleEntities(Set<BundleEntity> bundleEntities) {
this.bundleEntities = bundleEntities;
} |
7e7eca4f-3a51-49f1-9912-0fbdb734b5a2 | public List<ItemEntity> getAllItems() {
return allItems = findAllItems();
} |
613c3067-f0d7-4689-942f-4c8924941bcd | public void setAllItems(List<ItemEntity> allItems) {
this.allItems = allItems;
} |
eff3ba09-589b-49ae-bba4-d7806e5f9a96 | public ItemEntity getSelectedItem() {
return selectedItem;
} |
aed74277-c436-4f09-b019-7e383ca8d16a | public void setSelectedItem(ItemEntity selectedItem) {
this.selectedItem = selectedItem;
} |
aa3a8069-b060-41ec-826f-ab7dc7dc81a9 | public UserEntity getCurrentUser() {
return currentUser;
} |
536e0b70-e7df-49ea-b54d-c774ce86c77a | public void setCurrentUser(UserEntity currentUser) {
this.currentUser = currentUser;
} |
839f3af7-959c-4e20-916a-4e3862896e5a | public List<ItemEntity> getMovies() {
//0 means do not limit the number of rows returned.
return movies = findUniqueItemsByType("Movie", 0);
} |
00361204-c750-4f10-8814-4ad59d14ce2a | public void setMovies(List<ItemEntity> movies) {
this.movies = movies;
} |
45dc95ac-ea50-4083-8f97-f31c4afd1973 | public List<ItemEntity> getGames() {
return games = findUniqueItemsByType("Game", 0);
} |
2bbc31f0-fc28-4c77-abbb-4d1e69f79d07 | public void setGames(List<ItemEntity> games) {
this.games = games;
} |
57768fb0-a38d-4d36-be0d-576a8756c180 | public List<ItemEntity> getTopTen() {
return topTen = findItemsWithRatingGreaterThan(3);
} |
83da74f1-6ade-460d-b41c-2eb77d3038d8 | public void setTopTen(List<ItemEntity> topTen) {
this.topTen = topTen;
} |
70bb4e69-ff4c-49a0-9bbb-18829d98f352 | public List<ItemEntity> getLatestItems() {
return latestItems;
} |
4dc8d312-9678-48c2-9616-003930eafa29 | public void setLatestItems(List<ItemEntity> latestItems) {
this.latestItems = latestItems;
} |
202c8dd9-f5da-4f94-9cab-798cb04a0c0e | public Auth()
{
allowed = false;
} |
275975a2-89dc-4163-ac12-725cc201d377 | public static void run_auth(String pass)
{
password = pass;
// Call hash function to encrypt the input password
try
{
hash = hash_password(password);
System.out.println("Hashed password: " + hash);
}
catch (Exception e)
{
System.out.println("There was an error hashing the input password...");
e.printStackTrace();
}
// Call query function to retrieve hash from the DB
try
{
query_hash = query_hash();
System.out.println("Queried hash: " + query_hash);
}
catch (ClassNotFoundException e)
{
System.out.println("There was an error querying the database...");
e.printStackTrace();
}
} |
dd539ac5-a5d5-4eee-ac19-f4e789ba1bce | public static String hash_password(String password) throws Exception
{
// Digest the password with MD5 algorithm
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(password.getBytes());
byte byte_data[] = md.digest();
//convert the bytes to hex format
StringBuffer sb = new StringBuffer();
for (int i = 0; i < byte_data.length; i++)
{
sb.append(Integer.toString((byte_data[i] & 0xff) + 0x100, 16).substring(1));
}
//System.out.println("Hashed password: " + sb.toString());
return sb.toString();
}// END HASH_PASSWORD() |
fa71f68e-d602-49a9-bf60-8d36e05ccabb | @SuppressWarnings("finally")
private static String query_hash() throws ClassNotFoundException
{
Connection conn; // Initialize connection variable
CallableStatement cs; // Callable statement to be used for query
// Query the database for the stored hash
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
}
catch (InstantiationException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IllegalAccessException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
// Try connecting to database
try
{
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/ambience", "root", "buster");
// This prepares the stored procedure call by providing the procedure name and
// number of parameters involved. (IN, OUT).
cs = conn.prepareCall("{CALL get_password_hash(?,?)}");
// Registers the out parameter, 1 = in, 2 = out, the procedure returns type char(32)
cs.registerOutParameter(2, Types.CHAR);
// Prepares the string to be passed through 1 = IN as a string. User name will be passed
cs.setString(1, username);
// Executes the query with above parameters
cs.execute();
// Converts the output from the query to a string
query_hash = cs.getString(2);
}
catch (SQLException e)
{
System.out.println("Failed to connect to database...");
e.printStackTrace();
}
// Return result of query from database
return query_hash;
}// END QUERY_HASH() |
6e641a7e-534d-42e2-926b-db5b3b05d3e4 | public boolean is_allowed()
{
boolean allowed;
// Compare hashes to see if they match
if (hash.equals(query_hash))
{
System.out.println("Match successful!");
allowed = true;
}
else
{
System.out.println("Invalid credentials...");
allowed = false;
}
//if (fail_count >= 3)
//allowed = false;
return allowed;
}// END IS_ALLOWED() |
19146e7a-ae10-4be7-9b03-22ce20fa66b4 | @BeforeClass
public static void setUpBeforeClass() throws Exception {
if (em == null) {
em = (EntityManager) Persistence.
createEntityManagerFactory("g5.ambience").
createEntityManager();
}
} |
ede2dbf4-a118-45c0-a8b9-1d585ea43279 | @AfterClass
public static void tearDownAfterClass() throws Exception {
} |
40a56a47-ff04-419f-9c7d-7323e586e59b | @Before
public void setUp() throws Exception {
} |
6cd5d2a8-1f04-4e48-8100-1e5e4d3f4ab9 | @After
public void tearDown() throws Exception {
} |
61f6cfa4-b079-4830-a2c1-bc5143722edc | @Test
public void testUserEntity() {
em.getTransaction().begin();
UserEntity user1 = new UserEntity();
user1.setUsername("user");
user1.setPasswordHash("pass");
user1.setEmail("email@");
em.persist(user1);
em.flush();
em.getTransaction().commit();
} |
fa3fb143-bb33-4356-997c-255e56df6fba | @Test
public void testUserEntityStringStringStringStringString() {
em.getTransaction().begin();
UserEntity user2 = new UserEntity("admin","password","email","first","last","member");
em.persist(user2);
em.flush();
em.getTransaction().commit();
} |
4f9ad1dd-cb5e-4295-b0b9-327f65c817b5 | @Test
public void testUserAll(){
em.getTransaction().begin();
UserEntity user1 = em.find(UserEntity.class, "user");
UserEntity user2 = em.find(UserEntity.class, "admin");
em.remove(user1);
em.remove(user2);
em.getTransaction().commit();
} |
f9e6020b-fbb5-456d-a170-65454e7460a3 | @Test
public void testGetUsername() {
fail("Not yet implemented");
} |
aa566133-c1ef-403b-b703-dd4a7f8e912b | @Test
public void testSetUsername() {
fail("Not yet implemented");
} |
9f550fd3-2630-4ba3-9487-7c616e9bfa8b | @Test
public void testGetCcExpiration() {
fail("Not yet implemented");
} |
e31c8b55-f37b-40f4-a475-c962b2664dbd | @Test
public void testSetCcExpiration() {
fail("Not yet implemented");
} |
c68000c8-63e3-44de-bb89-6b775ea00587 | @Test
public void testGetCcName() {
fail("Not yet implemented");
} |
893d80c1-3e21-48e5-a61f-ad4dc92c788d | @Test
public void testSetCcName() {
fail("Not yet implemented");
} |
cabe357a-1d9d-4480-a290-09f0f74d2436 | @Test
public void testGetCcNumber() {
fail("Not yet implemented");
} |
fc1dad30-7e01-4203-9aed-3a2b8651a6dd | @Test
public void testSetCcNumber() {
fail("Not yet implemented");
} |
e1bb8a9d-c9c9-43f2-aeef-762b4ea8cf73 | @Test
public void testGetCcSecurity() {
fail("Not yet implemented");
} |
9da1583b-c2da-46c9-b642-d438d944ee01 | @Test
public void testSetCcSecurity() {
fail("Not yet implemented");
} |
db2f3d38-1812-4db1-a468-854f62839152 | @Test
public void testGetCity() {
fail("Not yet implemented");
} |
e1fa8d94-e440-45e0-90a3-d1153d52fc6c | @Test
public void testSetCity() {
fail("Not yet implemented");
} |
28c81b39-20fb-4eb6-be0c-d77e27cf50ab | @Test
public void testGetDob() {
fail("Not yet implemented");
} |
39e443e3-a16d-4117-b920-03a80de1d0e8 | @Test
public void testSetDob() {
fail("Not yet implemented");
} |
b42b8378-ddfa-4c43-926a-91f6988a9dcc | @Test
public void testGetEmail() {
fail("Not yet implemented");
} |
5a4c5937-c933-4343-9ceb-d53431431cfd | @Test
public void testSetEmail() {
fail("Not yet implemented");
} |
0aed84ff-c2e1-434a-b742-629b1ac9e3ca | @Test
public void testGetFirstName() {
fail("Not yet implemented");
} |
eadd9adc-fa0e-494c-bd95-8ce44f15ea66 | @Test
public void testSetFirstName() {
fail("Not yet implemented");
} |
8a2cd757-28f3-4291-bba7-3d066db33718 | @Test
public void testGetLastName() {
fail("Not yet implemented");
} |
8f8ffa63-a981-467a-8639-87fc71017967 | @Test
public void testSetLastName() {
fail("Not yet implemented");
} |
caf56f6b-53e9-4039-b8a6-ada1b0c44dfa | @Test
public void testGetMembershipPlan() {
fail("Not yet implemented");
} |
9bf51950-7551-4a3a-aad8-f420839fc3ce | @Test
public void testSetMembershipPlan() {
fail("Not yet implemented");
} |
dba9bed5-5085-4cb1-b6fd-9c60cac63732 | @Test
public void testGetPasswordHash() {
fail("Not yet implemented");
} |
47510edd-517f-43d8-bb1f-3a9f5dd8f02c | @Test
public void testSetPasswordHash() {
fail("Not yet implemented");
} |
7961c5cb-2c74-4475-8a22-ff9f8ca5937e | @Test
public void testGetProfileImage() {
fail("Not yet implemented");
} |
2e5d7842-2378-41a4-a389-9ef39b72127b | @Test
public void testSetProfileImage() {
fail("Not yet implemented");
} |
492089db-9ab0-42a8-9bda-782fed47dd75 | @Test
public void testGetRole() {
fail("Not yet implemented");
} |
928fcbfa-196f-4355-b2a5-c43b9532144f | @Test
public void testSetRole() {
fail("Not yet implemented");
} |
afb81842-5b37-4af6-9a11-1bc1afeac2b0 | @Test
public void testGetState() {
fail("Not yet implemented");
} |
6766f086-9b07-4b55-b9a3-2c6153cfb543 | @Test
public void testSetState() {
fail("Not yet implemented");
} |
600d752e-95b9-4ca9-892c-856f75188095 | @Test
public void testGetStreet() {
fail("Not yet implemented");
} |
c2ed3b82-6694-4f7d-89cc-fa574cba74c7 | @Test
public void testSetStreet() {
fail("Not yet implemented");
} |
386bbb4b-f6e1-48dc-a22e-51164a86b66a | @Test
public void testGetStreetOpt() {
fail("Not yet implemented");
} |
0d8745fb-ec8b-45b2-bbbd-4793b88b0a5b | @Test
public void testSetStreetOpt() {
fail("Not yet implemented");
} |
627c568c-319d-43ea-a153-4d9ef743ec59 | @Test
public void testGetZipcode() {
fail("Not yet implemented");
} |
f6ed3505-7dd6-4326-bdf1-fc995621f389 | @Test
public void testSetZipcode() {
fail("Not yet implemented");
} |
e2b652ee-25bb-4a12-b7dd-ff92cdee5928 | @Test
public void testGetBundleEntities() {
fail("Not yet implemented");
} |
1488898e-c90c-48e7-9f45-90cf05e19a85 | @Test
public void testSetBundleEntities() {
fail("Not yet implemented");
} |
acbc7720-ab06-4398-97d7-60219baf1ede | public ServiceImplementation() {
TodoItem first = new TodoItem();
first.setDescription("First FuckUp Item");
first.setPrio(1);
Integer id = idCounter.incrementAndGet();
todoDB.put(id,first);
} |
9b3d4e2d-5b1f-4de7-948f-c9c8dce712ef | public void setRemote(){
todoDB.get(1).setDescription(todoDB.get(1).getDescription()+" remote");
} |
c1219949-25af-44dd-b46a-0740b982edb5 | public TodoItem[] getItems() {
return todoDB.values().toArray(new TodoItem[0]);
} |
ec386a48-cc8c-479d-908a-35c8e256e59c | public Integer takeItem(TodoItem tdi){
Integer id = idCounter.incrementAndGet();
todoDB.put(id, tdi);
return id;
} |
e6cf0f8c-58e6-4fc1-8e29-91d7a1bfad91 | public TodoItem getItem(int id) throws SomeApplicationException {
TodoItem result = todoDB.get(id);
if (result == null)
throw new SomeApplicationException("No Item");
return result;
} |
371b388d-6f78-4d71-a53b-01ac2e1c12c4 | public SomeApplicationException (String m){
super(m);
} |
d2c67e26-c15c-40ae-817f-fea444b480b5 | public SomeApplicationException (){
super();
} |
c97210a0-5f8a-4a2c-876e-2ab88e22a189 | public String getDescription() {
return description;
} |
a09a5ce7-4584-4a17-a181-a394d85acf58 | public void setDescription(String descrition) {
this.description = descrition;
} |
f92b8c19-998e-411f-a8c2-d8817bc81eb7 | public int getPrio() {
return prio;
} |
508dbc92-8b21-4eae-baa1-54bcc8eb47ad | public void setPrio(int prio) {
this.prio = prio;
} |
098be067-f8fe-470a-bfbf-7025aa65baa2 | @GET
@Path("/item")
@Produces(MediaType.APPLICATION_JSON)
public TodoItem[] getItems(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.