OpenCL 1.0 came with nVidia driver for Mac OS X 10.6. I wonder if/how it is possible to update header files to utilize OpenCL 1.1 API. Greatly appreciate in advance.
If I have a class that holds one or several lists is it better to allow other classes to fetch those lists(with a getter) or to implement a doXList/eachXList type method for that list that take a function and call that function on each element of the list contained by that object. I wrote a program that did a ton of this and I hated passing around…
I haven't ever before created custom components in JSF so I've noticed only now that methods like encodeBegin(), encodeEnd() etc accept FacesContext parameter.
FacesContext instance can usually be received with FacesContext.getCurrentInstance().
So, I wonder whether these methods have FacesContext parameter just for convenience or some…
I have a form with a ComboBox and a ListView, when I press the down key on the Dpad focus moves from ComboBox to the items in the listView. But then I cant get out of the ListView and focus on the ComboBox again, I can only go up and down in the ListView items, how do I let the user go back to the ComboBox?
I used Collections.sort(playersList); to sort a list. So, I think playersList is sorted now. But how can I get the first element of the list? playersList[0] does not work.
So I'm trying to document the format of the json returned by an api I am writing against and I'd like to know if there is any popular format for the documentation of json structure.
Note I'm not trying to to test or validate anything, I'm just using this for documentation. Also some ways to add comments to non-constants(items always…
I don't know haskell syntax, but I know some FP concepts (like algebraic data types, pattern matching, higher-order functions ect).
Can someone explain please, what does this code mean:
data Tree ? = Leaf ? | Fork ? (Tree ?) (Tree ?)
rotateR tree = case tree of
Fork q (Fork p a b) c -> Fork p a (Fork q b c)
As I understand,…
I wonder if it's reliable to use a construction like:
private static final Map<String, String> engMessages;
private static final Map<String, String> rusMessages;
static {
engMessages = new HashMap<String, String> () {{
put ("msgname", "value");
}};
rusMessages = new HashMap<String,…
Hi All
I am wondering if someone would be such an expert in guice that he even would know how to implement that :
I have an injection annotation (@ConfParam)with some parameters , like that :
class TestClass {
private final int intValue;
@Inject
public TestClass(@ConfParam(section = "test1", key = "1") int…
i got a little problem with a wordpress site that uses contact form 7 and android browser (at least android v1.5).
when a user submits the cf7 form (using ajax followed by a js redirect) and tries to return to the forms page later (using the back button as well as opening the form's url) the download prompt for a…
I use outputPanel.setLayout(new BoxLayout(outputPanel, BoxLayout.Y_AXIS)); and then I add elements (for example JLabels, JButtons) to the outputPanel. For example: outputPanel.add(submitButton);.
I see that all added elements are "centered". It is good, because I do want my elements to be in the center. When I…
I'm quite new to the world of 2D-Engines. I figured out how to load images and display those as sprites and stuff, but theres one question that bugs me.
For instance, when a "rocket" hits an object it will deal damage to it and leave a crater behind. I'd like to have the crater shown on that object. That would…
I try to add an image to JPanel. It works if I specify the full name of the image (including name of all folders). But I want my software to be machine independent (another machine does not have the same folder structure as my machine has). So, I put my image to the same place where the source is and in my code…
I have an interface ProductService with method findByCriteria. This method had a long list of nullable parameters, like productName, maxCost, minCost, producer and so on.
I refactored this method by introducing Parameter Object. I created class SearchCriteria and now method signature looks like this:
…
Background
I'm going to develop a new web-application with java. It's not very big or very complex and I have enough time until it'll "officially" start.
I have some JSF/Facelets development background (about half a year). And I also have some expirience with JSP+JSTL.
In self-educational purpose…
I try to play with sockets a bit. For that I wrote very simple "client" and "server" applications.
Client:
import java.net.*;
public class client {
public static void main(String[] args) throws Exception {
InetAddress localhost = InetAddress.getLocalHost();
System.out.println("before");…
I'm using IntelliJ IDEA and I tried its tool for building class diagram. Unfortunatelly, it draws classes from java package as well as necessary classes. That's why built diagram is very messed.
Are there any more smart tool? Or, is there any way to 'turn off' drawing java classes in IDEA?
We create a socket. On one side of the socket we have a "server" and on another side there is a "client". Both, the server and client, can write to and read from the socket. It is what i understand. I do not understand the following things:
If a server reads from the socket, does it see in the…
Is there a way of sending notification about new wordpress-based blog to facebook account?
Or maybe a plugin for wordpress?
Restriction is that user shouldn't be logged into facebook, just specify facebook credentials to the plugin.
I have some base class ControlBase and many derived classes which also have derived classes... ControlBase and derived classes have parameterless constructor. How can I easily find all derived classes constructor invocation points? ReSharper find usages on ControlBase constructor shows only…
In one of my directories I have all .java files which belong to one package ("game"). Now I want to create one .java file which does not belong to this package and which imports the "game" package. If I create a new file and write import game; then Eclipse complains that it does not know…
I have a class with a fields called "a". In the class I have a method and in the list of arguments of this method I also have "a". So, which "a" I will see inside of the method? Will it be the field or it will be the argument of the method?
public class myClass {
private String a;
…
In ASP.NET MVC there is Model, View and Controller.
MODEL represents entities which are stored in database and essentially is all the data used in a application (for example, generated by EntityFramework, "DB First" approach).
Not all data from model you want to show in the view (for…