Search Results

Search found 1156 results on 47 pages for 'roman'.

Page 20/47 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Why Eclipse does not see .jar file of a library?

    - by Roman
    I have a java project in which I have "Referenced Libraries". In the "Referenced Libraries" I have a .jar file of a library that I use (I use only one external library). When I try to "Run - Run" the code I have a NullPointerException. From my previous experience I know that it it (very likely) because my code does not see the library. I just started to use Eclipse and it can be the I do not "connect" libraries in a correct way. Should I use some options or additional action to force Eclipse to see the .jar file of the library? ADDED: By the right click on the library I get a drop-down menu in which I see "Build Path". My be I need to do something there?

    Read the article

  • Can I process video using flash?

    - by Roman
    I want to have a web page where user can activate his/her web-camera and send video to another user. Additionally to that I want to have a possibility to process video on the client side. In more details, I want to have a program which analyze video on the client side. Is it possible to do it with Flash?

    Read the article

  • android browser downloadfile.bin (wordpress cf7)

    - by roman
    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 'downloadfile.bin' appears. this behavior can not be reproduced on any other mobile or desktop browsers. could anyone shed some light on this issue? thank you in advance!

    Read the article

  • Pros and cons of sorting data in DB?

    - by Roman
    Let's assume I have a table with field of type VARCHAR. And I need to get data from that table sorted alphabetically by that field. What is the best way (for performance): add sort by field to the SQL-query or sort the data when it's already fetched? I'm using Java (with Hibernate), but I can't tell anything about DB engine. It could be any popular relational database (like MySQL or MS Sql Server or Oracle or HSQL DB or any other). The amount of records in table can vary greatly but let's assume there are 5k records.

    Read the article

  • Is the a pattern for iterating over lists held by a class (dynamicly typed OO languages)

    - by Roman A. Taycher
    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 all these lists sometimes with method in class a calling method in class B to return lists contained in class C, B contains a C or multiple C's (note question is about dynamically typed OO languages languages like ruby or smalltalk) ex. (that came up in my program) on a Person class containing scheduling preferences and a scheduler class needing to access them.

    Read the article

  • Is there anything bad in declaring static inner class inside interface in java?

    - by Roman
    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: findByCriteria (SearchCriteria criteria) I thought that instances of SearchCriteria are only created by method callers and are only used inside findByCriteria method, i.e.: void processRequest() { SearchCriteria criteria = new SearchCriteria () .withMaxCost (maxCost) ....... .withProducer (producer); List<Product> products = productService.findByCriteria (criteria); .... } and List<Product> findByCriteria(SearchCriteria criteria) { return doSmthAndReturnResult(criteria.getMaxCost(), criteria.getProducer()); } So I did not want to create separate public class for SearchCriteria and put it inside ProductServiceInterface: public interface ProductService { List<Product> findByCriteria (SearchCriteria criteria); static class SearchCriteria { ... } } Is there anything bad in this interface? Where whould you place SearchCriteria class?

    Read the article

  • What resources to look to in order to write an emulator for iPhoneOS?

    - by Roman Kagan
    What are available resources I should look to in order to write an emulator for iPhoneOS? I'd like to write an emulator to run applications written for MacOS. I understand that I won't be able to use file system and other OS resources. I do have an SDK, XCode and all documentation for those resources, but I wonder if I can find some examples (perhaps similar to the emulator that can run Ninetendo games on iPhone)?

    Read the article

  • Why do sockets not die when server dies? Why does a socket die when server is alive?

    - by Roman
    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"); Socket clientSideSocket = null; try { clientSideSocket = new Socket(localhost,12345,localhost,54321); } catch (ConnectException e) { System.out.println("Connection Refused"); } System.out.println("after"); if (clientSideSocket != null) { clientSideSocket.close(); } } } Server: import java.net.*; public class server { public static void main(String[] args) throws Exception { ServerSocket listener = new ServerSocket(12345); while (true) { Socket serverSideSocket = listener.accept(); System.out.println("A client-request is accepted."); } } } And I found a behavior that I cannot explain: I start a server, than I start a client. Connection is successfully established (client stops running and server is running). Then I close the server and start it again in a second. After that I start a client and it writes "Connection Refused". It seems to me that the server "remember" the old connection and does not want to open the second connection twice. But I do not understand how it is possible. Because I killed the previous server and started a new one! I do not start the server immediately after the previous one was killed (I wait like 20 seconds). In this case the server "forget" the socket from the previous server and accepts the request from the client. I start the server and then I start the client. Connection is established (server writes: "A client-request is accepted"). Then I wait a minute and start the client again. And server (which was running the whole time) accept the request again! Why? The server should not accept the request from the same client-IP and client-port but it does!

    Read the article

  • ReSharper: find derived types constructor usages points

    - by Roman
    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 usages of this base class constructor but not derived classes constructors. Thanks.

    Read the article

  • Why I cannot see an image if I do not use the full name of an image?

    - by Roman
    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 use just name of the image (no folders' names). It does not work. I put my image into the folder where my executables are. It does not work again. So, why it does not work and what can I do with that?

    Read the article

  • Right rotate of tree in Haskell: how is it work?

    - by Roman
    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, first line is something like Tree-type declaration (but I don't understand it exactly). Second line includes pattern matching (I don't understand as well why do we need to use pattern matching here). And third line does something absolutely unreadable for non-haskell developer. I've found definition of Fork as fork (f,g) x = (f x, g x) but I can't move further anymore.

    Read the article

  • How to import a module from a directory?

    - by Roman
    On my system I have two versions of Python (to call them I type python and python2 in the command line). When I use the first version of Python, I cannot import sklearn module but I can do it in the second version of Python. I would like to use the first version of python (because other modules are available there) and, at the same time, I would like to be able to import sklearn from this version of Python. My solution was to use: import sys sys.path.append('location_of_the_sklearn_module') To find the location of the sklearn module I started a python session (using the second version of python, in which sklearn works). The I type: import sklearn sklearn.__file__ As a result I got: /home/name/my_name/numpy/local/lib/python2.7/site-packages/sklearn/__init__.pyc In the session of the first version of Python I tried: import sys sys.path.append('/home/name/my_name/numpy/local/lib/python2.7/site-packages/sklearn') import sklearn Unfortunately it did not work. As a result I got: ImportError: No module named sklearn Does anybody know what I am doing wrong and if it is possible to reach the goal in the way I try?

    Read the article

  • How the reading from and writing to sockets are synchronized?

    - by Roman
    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 socket only those stuff which was written to the socket by the client? I mean if server writes something to the socket and than reads from the socket, will it (server) see in the socket the stuff it (server) wrote there? I hope not. Let's consider the following situation. A client write something to the socket and then it writes something new to the socket and then server reads from the socket. What will the server see there? Only the "new" stuff written by the client or both "new" and "old" one? If a client (or server) writes to the socket, can it see if the written information was received by other side? For example out.println("Hello, Server!") will return true it server received this message.

    Read the article

  • Use cases of [ordered], the new PowerShell 3.0 feature

    - by Roman Kuzmin
    PowerShell 3.0 CTP1 introduces a new feature [ordered] which is somewhat a shortcut for OrderedDictionary. I cannot imagine practical use cases of it. Why is this feature really useful? Can somebody provide some useful examples? Example: this is, IMHO, rather demo case than practical: $a = [ordered]@{a=1;b=2;d=3;c=4} (I do not mind if it is still useful, then I am just looking for other useful cases). I am not looking for use cases of OrderedDictionary, it is useful, indeed. But we can use it directly in v2.0 (and I do a lot). I am trying to understand why is this new feature [ordered] needed in addition. Collected use cases from answers: $hash = [ordered]@{} is shorter than $hash = New-Object System.Collections.Specialized.OrderedDictionary N.B. ordered is not a real shortcut for the type. New-Object ordered does not work. N.B. 2: But this is still a good shortcut because (I think, cannot try) it creates typical for PowerShell case insensitive dictionary. The equivalent command in v2.0 is too long, indeed: New-Object System.Collections.Specialized.OrderedDictionary]([System.StringComparer]::OrdinalIgnoreCase)

    Read the article

  • Are there any garanties in JLS about order of execution static initialization blocks?

    - by Roman
    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, String> () {{ put ("msgname", "????????"); }}; } private static Map<String, String> msgSource; static { msgSource = engMessages; } public static String msg (String msgName) { return msgSource.get (msgName); } Is there a possibility that I'll get NullPointerException because msgSource initialization block will be executed before the block which initializes engMessages? (about why don't I do msgSource initialization at the end of upper init. block: just the matter of taste; I'll do so if the described construction is unreliable)

    Read the article

  • How to center elements in the BoxLayout using center of the element?

    - by Roman
    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 write "center" I mean "equal distance from left and right". But the problem is that the left part of the element is put into the center. And I want to have center of elements to be put into the center. How can I get this behavior?

    Read the article

  • Facebook notification of Wordpress post

    - by Roman
    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.

    Read the article

  • How can I add a .jar to my build path in Eclipse?

    - by Roman
    I try to do it the following way: Right click on the name of the project. Click on Build Path in the drop dawn menu. Click on "Configure Build Path" And then I do not know what to do. Should I select "Source", "Projects", "Libraries", "Order and Export"? In "Libraries" I have "Add JARs..." and "Add External JARs...". What should I select? (I have already a .jar file in the lib folder of my project.) ADDED: If I click on "Add JARs" in the "Libraries" tab, I see the "lib" sub-folder but if I go there I do not see my .jar file there (and I know that it is there).

    Read the article

  • Why sockets does not die when server dies? Why socket dies when server is alive?

    - by Roman
    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"); Socket clientSideSocket = null; try { clientSideSocket = new Socket(localhost,12345,localhost,54321); } catch (ConnectException e) { System.out.println("Connection Refused"); } System.out.println("after"); if (clientSideSocket != null) { clientSideSocket.close(); } } } Server: import java.net.*; public class server { public static void main(String[] args) throws Exception { ServerSocket listener = new ServerSocket(12345); while (true) { Socket serverSideSocket = listener.accept(); System.out.println("A client-request is accepted."); } } } And I found a behavior that I cannot explain: I start a server, than I start a client. Connection is successfully established (client stops running and server is running). Then I close the server and start it again in a second. After that I start a client and it writes "Connection Refused". It seems to me that the server "remember" the old connection and does not want to open the second connection twice. But I do not understand how it is possible. Because I killed the previous server and started a new one! I do not start the server immediately after the previous one was killed (I wait like 20 seconds). In this case the server "forget" the socket from the previous server and accepts the request from the client. I start the server and then I start the client. Connection is established (server writes: "A client-request is accepted"). Then I wait a minute and start the client again. And server (which was running the whole time) accept the request again! Why? The server should not accept the request from the same client-IP and client-port but it does!

    Read the article

  • Passing ViewModel for backbone.js from MVC3 Server-Side

    - by Roman
    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 example, hashs of passwords). So you create VIEW MODEL, each for every strongly-typed-razor-view you have in application. Like this: using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace MyProject.ViewModels.SomeController.SomeAction { public class ViewModel { public ViewModel() { Entities1 = new List<ViewEntity1>(); Entities2 = new List<ViewEntity2>(); } public List<ViewEntity1> Entities1 { get; set; } public List<ViewEntity2> Entities2 { get; set; } } public class ViewEntity1 { //some properties from original DB-entity you want to show } public class ViewEntity2 { } } When you create complex client-side interfaces (I do), you use some pattern for javascript on client, MVC or MVVM (I know only these). So, with MVC on client you have another model (Backbone.Model for example), which is third model in application. It is a bit much. Why don`t we use the same ViewModel model on a client (in backbone.js or another framework)? Is there a way to transfer CS-coded model to JS-coded? Like in MVVM pattern, with knockout.js, when you can do like this: in SomeAction.cshtml: <div style="display: none;" id="view_model">@Json.Encode(Model)</div> after that in Javascript-code var ViewModel = ko.mapping.fromJSON($("#view_model").get(0).innerHTML); now you can extend your ViewModel with some actions, event handlers, etc: ko.utils.extend(ViewModel, { some_function: function () { //some code } }); So, we are not building the same view model on the client again, we are transferring existing view model from server. At least, data. But knockout.js is not suitable for me, you can`t build complex UI with it, it is just data-binding. I need something more structural, like backbone.js. The only way to build ViewModel for backbone.js I can see now is re-writing same ViewModel in JS from server with hands. Is there any ways to transfer it from server? To reuse the same viewmodel on server view and client view?

    Read the article

  • Is there anything bad in declaring nested class inside interface in java?

    - by Roman
    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: findByCriteria (SearchCriteria criteria) I thought that instances of SearchCriteria are only created by method callers and are only used inside findByCriteria method, i.e.: void processRequest() { SearchCriteria criteria = new SearchCriteria () .withMaxCost (maxCost) ....... .withProducer (producer); List<Product> products = productService.findByCriteria (criteria); .... } and List<Product> findByCriteria(SearchCriteria criteria) { return doSmthAndReturnResult(criteria.getMaxCost(), criteria.getProducer()); } So I did not want to create a separate public class for SearchCriteria and put it inside ProductServiceInterface: public interface ProductService { List<Product> findByCriteria (SearchCriteria criteria); static class SearchCriteria { ... } } Is there anything bad with this interface? Where whould you place SearchCriteria class?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >