Comment by LuckyLuke on Handling errors in Swift
Yes, you mean that I should pass the error object to the completion handler as is. But how do I know, in the other end, which error it was?? Do I need to run into the error first then, log it and then...
View ArticleComment by LuckyLuke on How to keep Quotes For Making proper SQL Query
Use prepared statements
View ArticleComment by LuckyLuke on Checkmarks in UITableViewCells showing incorrectly
Do you want only one cell to be checked at the same time?
View ArticleComment by LuckyLuke on Handling errors in Swift
So what about the situation where the moveItemAtURL fails? How do you handle that, what should I do with it. How would the code example I gave look for the caller? What should the code look like. I...
View ArticleComment by LuckyLuke on Handling errors in Swift
Thank you for answering. So do you create one huge Enum with all the error codes in the application, no matter where they come from? And how should I know which error codes to catch if there are nested...
View ArticleComment by LuckyLuke on Handling errors in Swift
Thank you, many good points that I will bring with me when I am experimenting. However, I have some questions. It seems like it is the handleError method that do "all" the error handling, am I correct?...
View ArticleComment by LuckyLuke on Internationalization/localization of data in Parse?
Didn't you read my question? I am stating that I am using Parse and I wonder how to add localization for my data.
View ArticleWhat is a graphic context? (iOS)
What exactly is a graphic context? When drawing with Core Graphic we get a reference to the context. When I look at the documentation it seems like it is an object or so that take care of the correct...
View ArticleAnswer by LuckyLuke for Using a regular expression to validate email addresses
What you have written works with some small modifications if that is what you want to use, however you miss a '+' at the end.1) ^[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-zA-Z0-9]+$ The caret and dollar character...
View ArticleJPA @GeneratedValue(strategy=GenerationType.AUTO) does not work on MySQL
I have an entity that is supposed to get an id from the database automatically. I use MySQL so I would expect annotating that @GeneratedValue(strategy=GenerationType.AUTO) would resolve to IDENTITY...
View ArticleJBoss 7.x or JBoss EAP 6.x
I am installing JBoss but I don't understand which version to choose. Should I download JBoss 7.x or the JBoss EAP 6.x? What is the difference?
View ArticleGenerate tables from entities in IntelliJ 11 IDEA
Are there no option to generate tables from entities in IntelliJ? Using JPA and eclipselink as implementation. Trying to generate tables for MySQL. All I see is options for importing.Do I have to use...
View ArticleWhere to find all available Java mail properties?
Where do I find a list of all available Java mail properties that I can pass to the Session object? I am only able to find basic properties in the API. Browsing blogs to find some more properties isn't...
View ArticleURIs for composite objects in RESTful web service
I have created the paths:POST /books/4/chapters The Chapter entity is part of the Book composition. It can not exist in the system without a book. Now after creating a chapter by posting to the URI...
View ArticleHow to add placeholder attribute to JSF input component?
Shouldn't this line of code render a inputtext field with the placeholder text "fill me" when using html5? <h:inputText placeholder="fill me" />I do not see any placeholder text. I thought...
View ArticleHow to use enum values in f:selectItem(s)
I want to make a selectOneMenu dropdown so I can select a status on my question. Is it possible to make the f:selectItem more flexible considering what happens if the order of the enums changes, and if...
View ArticleGranting permission in Spring Security Acl
I am using Spring Security ACL. When I save an object I also create a new ACE (Access Control Entry). I am using this method:acl.insertAce(acl.getEntries().size(), BasePermission.CREATE, recipient,...
View ArticleShards and replicas in Elasticsearch
I am trying to understand what shard and replica is in Elasticsearch, but I didn't manage to understand it. If I download Elasticsearch and run the script, then from what I know I have started a...
View ArticleUnable to embed YouTube video with YTPlayerView NSCocoaErrorDomain Code=258
Embedding YouTube videos with YTPlayerView doesn't work. It only gives me this error in the log:2015-12-12 20:19:45.229 Wax-room[8545:3426005] Received error rendering template: Error...
View ArticleWhat are the purpose of intent categories?
Could someone please explain me the purpose of Intent categories? When should I make my own and so on? The only thing thats written about Intent categories in my book is that they can group intents?.
View ArticleJenkins does not start properly after reboot on GCE
If I need to restart Jenkins due to installing a plugin for instance the slaves are never turned on. I am using Google Compute Engine. I followed this...
View ArticleWhen to use a "has_many :through" relation in Rails?
I am trying to understand what has_many :through is and when to use it (and how). However, I am not getting it. I am reading Beginning Rails 3 and I tried Googling, but I am not able to understand.
View ArticleMultipleBagFetchException thrown by Hibernate
I want to have an option in my repository layer to eager load entites, so I tried adding a method that should eager load a question entity with all the relationships, but it throws...
View ArticleWhy do we use a DataSource instead of a DriverManager?
I am reading the Java JDBC specification (vr. 4) and I encountred this statement:DataSource — this interface was introduced in the JDBC 2.0 Optional Package API. It is preferred over DriverManager...
View ArticleDocker: Multiple Dockerfiles in project
How do you organize the Dockerfiles belonging to a project when you have one Dockerfile for the database, one for the application server, and so on? Do you create some sort of hierachy in the source?A...
View ArticleMargin/padding in GridBagLayout Java
Is it possible to set an margin/padding in GridBagLayout for the whole row/column? I use the inset on the constraints-object however, using this approach I need to set padding from bottom on every...
View ArticleUsing Spring MVC Test to unit test multipart POST request
I have the following request handler for saving autos. I have verified that this works when I use e.g. cURL. Now I want to unit test the method with Spring MVC Test. I have tried to use the...
View ArticleHow does apply-templates work?
I have just started learning XSL(T) and I wonder how apply-templates work? I do not understand the recursively applies templates part of it as it is written in my book.I understand the XPath-part of...
View ArticleDifference between one-to-one and one-to-many relationship in a database
When having a one-to-one relationship in a database the other table has a foreign key ID (in this example). And in a one-to-many relationship the table contains many foreign keys.But does the database...
View ArticleWhat is an index in Elasticsearch
What is an index in Elasticsearch? Does one application have multiple indexes or just one?Let's say you built a system for some car manufacturer. It deals with people, cars, spare parts, etc. Do you...
View ArticleHow to POST JSON and a file to web service with Angular?
How do I send a POST request with AngularJS? The JSON part is required but the file is not. I have tried this based on other blog posts but it does not work. I get a Bad request 400 error.var test = {...
View ArticleEqual height of UICollectionViewCell's and UICollectionView
How am I supposed to set the height of the cells in UICollectionView equal to the height of whatever the collection view is? The code below doesn't work because the collection views height is not known...
View ArticleShould I use @EJB or @Inject
I have found this question: What is the difference between @Inject and @EJB but I did not get any wiser. I have not done Java EE before nor do I have experience with dependency injection so I do not...
View ArticleHow to get URL for application's document directory iPhone
This code is a part of Core Data. The URLsForDirectory....method does not run on iOS < 4 so I need to know some other methods/objects to call. I would also appriciate documentation for future...
View ArticleWhat are "connecting characters" in Java identifiers?
I am reading for SCJP and I have a question regarding this line:Identifiers must start with a letter, a currency character ($), or a connecting character such as the underscore ( _ ). Identifiers...
View ArticleWhere is my app placed when deploying to Tomcat using IntelliJ IDEA?
I am deploying an application from IntelliJ IDEA to the local Tomcat server. I thought the apps you deploy are placed in the webapps folder, however it does not turn up there.Is this correct? Where is it?
View ArticleProblems with making a query when using Enum in entity
I have the following in a Question entity:@NamedQuery(name = "Question.allApproved", query = "SELECT q FROM Question q WHERE q.status = 'APPROVED'")and@Enumerated(EnumType.STRING)private Status...
View Article