Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Neo10101

@Neo10101
About
Posts
61
Topics
33
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Enterprise application architecture
    N Neo10101

    There is no need to give me replies like that to every question I ask. My colleague is on vacation.

    Java java asp-net architecture

  • how to build 3d box
    N Neo10101

    It looks like I'm not the only one you show this autistic behavior towards. Bye.

    Java java tutorial question

  • Enterprise application architecture
    N Neo10101

    I took a look at someone's code here and I am trying to understand its architecture: We are looking at a classic enterprise architecture using Spring core for dependency injection.

    import org.springframework.beans.factory.annotation.Autowired;

    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.List;

    public class FavoriteService {
    @Autowired
    private Users users;

    public boolean checkLogin(String username, String password) {
        return users.login(username, password);
    }
    
    
    public void addUser(String root, String rootpasswd, String username, String password) {
        if(root.equals("root")&&rootpasswd.equals("rootpasswd")) {
            users.addUser(username, password);
        }
    }
    
    public User getUser(String username){
        return users.getUser(username);
    }
    
    public List<String> getFavorites(String username, String password) {
        if (getUser(username) == null) return new ArrayList<>();
    }
    
    public void addFavorite(String username, String password, String favorite1) {
            users.addFavorite(username,password,favorite1);
    }
    
    public void removeFavorite(String username, String password, String favorite1) {
        users.removeFavorite(username,password,favorite1);
    }
    
    public void addFavorite(String username, String password, String favorite1) {
    
    }
    

    }

    import java.util.ArrayList;
    import java.util.List;

    public class User {
    private final String username;
    private final String password;
    private final List favorites = new ArrayList<String>();

    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }
    
    public String getPassword() {
        return password;
    }
    
    public String getUsername() {
        return username;
    }
    
    public List<String> getFavorites(){
        return favorites;
    }
    
    public void addFavorite(String favorite){
        favorites.add(favorite);
    }
    
    public void removeFavorite(String favorite) {
        favorites.remove(favorite);
    }
    

    }

    public interface UserDao {
    public void create(User user);

    public User getUser(String username);
    

    }

    import java.util.HashMap;
    import java.util.Map;

    public class UserDaoWithMap implements UserDao {

    Java java asp-net architecture

  • Package structure best practices?
    N Neo10101

    What is the best way to structure the naming of your (java) packages? By design paradigm: my.app.dao, my.app.services, my.app.util, my.app.model, etc. or by function/context name: my.app.clients, my.app.registration, my.app.production, my.app.accountancy? On a side note: I think I remember watching a keynote speech on the Spring framework where a developer advocated the structuring of packages according to the application's domain functions. The same would happen for URLs: /login /register /products/sales /products/production /accountancy/general-ledger /accountancy/analysis The problem of the classic paradigm package structure would be redundancy/visibility problems: services/userregistration services/agenda services/products model/userregistration model/agenda model/products dao/userregistration dao/agenda dao/products Each function is repeated per layer. What is the best approach?

    Java java question design sales help

  • Local Object Reference escaping
    N Neo10101

    In terms of thread safety: How can it be determined an object escapes a method call, without using JVM escape analysis? ('Escaping' means that an object can be accessed after the method completes) A couple of examples on how an object can escape a method call: 1) The method returns the object that was locally created:

    public MyObject someMethod(){
    MyObject localObject = new MyObject();
    return localObject();
    }

    //Another thread can now mutate this object because it has a reference to it:
    someMethod.changeSomething();

    1. One of the methods called with the LocalObject as parameter, stores the LocalObject instance in a way that allows access to it from other threads.

        MyMember member;          
      
        public void someMethod(){  
            LocalObject localObject = new LocalObject();  
      
            localObject.callMethod();  
            method2(localObject);  
        }  
      
        public void method2(LocalObject localObject){  
            localObject.setValue("value");  
            member = localObject;  
        }  
      

    Does anyone know any more practical examples on how an object can escape a method call?

    Java java question

  • An MVC concern
    N Neo10101

    I noticed in one of my professor's MVC Java programming projects he put a Controller class inside a model package. Is it true that in MVC often people use just MV and don't bother with the C because they don't think it's worth creating another layer just for a couple of extra classes? It seemed illogical to me to put a controller inside a model package.

    Java java asp-net architecture question

  • is java is pure object oriented langage
    N Neo10101

    Yes, it is. 100% sure.

    Java java oop

  • An MVC concern
    N Neo10101

    My mistake. I thought I was on the 'General Questions' forum.

    C# java asp-net architecture question

  • An MVC concern
    N Neo10101

    I noticed in one of my professor's MVC Java programming projects he put a Controller class inside a model package. Is it true that in MVC often people use just MV and don't bother with the C because they don't think it's worth creating another layer just for a couple of extra classes? It seemed illogical to me to put a controller inside a model package.

    C# java asp-net architecture question

  • Is Microsoft Navision dead?
    N Neo10101

    Businesses' sole purpose is not making money. That is old-boxed thinking. Today's businesses' main goal is to make a difference in this world and make it a better world. There are also other important goals to consider such as being 'Green', i.e. Corporate Social Responsibility. Businesses exist to differentiate and evolve our society so we can identify ourselves as a nation and not only in the economical aspect. One of the main drivers behind a business is to make software, i.e. to give the customers what they want. That is why there are courses like Software Engineering, where functional analysis and business intelligence, data mining is taught. Companies are linear organized solutions of people who put out bright ideas into the world and form them into life. Long term thinking also has to be applied; it would be better in long term in some situations to change the business solutions rather than keeping the old ones. This is where modern consultants come in and where they show the old, conservative and obstinant nay-sayers that they are wrong in their views and that a more modern solution is viable. It all comes down to great ideas that need to be translated to great solutions, which is something 90% of the companies today are struggling with: failure to translate Business Strategy into Implementation down the company pipeline.

    C# question business

  • Is Microsoft Navision dead?
    N Neo10101

    Haha.

    C# question business

  • Is Microsoft Navision dead?
    N Neo10101

    Of course the company itself is not going to talk negatively about itself. Outside verified opinions and views are needed.

    C# question business

  • Is Microsoft Navision dead?
    N Neo10101

    We had some COBOL in our freshman year.

    C# question business

  • Is Microsoft Navision dead?
    N Neo10101

    At our university we are being trained to use Microsoft Dynamics Navision 2013. However, one of my co-students refuses to learn and/or use that software because he claims it is dead (according to his father who is an important CIO). Apparently Navision is 'bloatware' that went nearly bankrupt and Microsoft decided to buy it and use it for re-profit (as my co-student stated). He told me that in many companies installing Navision or any kind of Microsoft product like that is against company policy because that software is 'horribly inefficient'. I am not sure of the details. So assuming Navision is dead, then why does my university put it in its program? Why is it 'a preparation for the business world' if the software is allegedly dead in use?

    C# question business

  • Website visit automation script
    N Neo10101

    The script needs to visit a series of game retailer websites and input some keywords into their search boxes. Then it yields the product results sorted by price in an HTML table in a separate page. The resulting HTML table is a list of the accumulated results. The goal is to obtain a sorted overview of the total result set, sorted by price so that the cheapest version of the game (lowest price) is visible on the top of the list. How would I begin coding this? Is another implementation language recommended (Javascript, AHK, Selenium, etc.)?

    C# tools javascript html game-dev testing

  • Object mutability
    N Neo10101

    Referring to that article, Listing 1: Q.: "Because Date is mutable, the scheduleTask method must be careful to defensively copy the date parameter (perhaps through clone()) into its internal data structure. Otherwise, task1 and task2 might both execute tomorrow, which is not what was desired. Worse, the internal data structure used by the task scheduler could become corrupt." A few questions on this: 1) What is 'copying defensively'? 2) What do they mean by 'internal data structure'? 3) How could task1 and task2 execute tomorrow if the code is to be executed today? Then how can new Date() be tomorrow? I don't understand. 4) How would the internal data structure become 'corrupt'? What is 'corrupt' in this context? Containing inconsistent values?

    Java question functional tutorial

  • Object mutability
    N Neo10101

    How would one mutate an object that is final? By referencing the object and then doing a mutate() operation on it? e.g.:

    final Object o = new Object();
    o.mutate();

    I don't understand. If it was declared final, then how come you are allowed to mutate it (or is that not true)? How would one make the Object immutable then? Meaning: not mutable in any way, not even by reference. How do I make sure a reference cannot modify the object it refers to? So that MyObject o = new Object(); o.modify(); is not possible? I also read on Wikipedia the following example:

    final Position pos = new Position(); //pos is immutable

    members: pos.x, pos.y, pos.z are mutable still, unless they are declared final. So if I am understanding this correctly, in order to make an object/class completely immutable, everything in it including its reference has to be declared final? e.g.:

    final Position pos = new Position();

    class Position {
    final int x;
    final int y;
    final int z;

    public Position(){
    x=1;
    y=2;
    z=3;
    }

    final void doA(){}
    final void doB(){}
    }

    Java question functional tutorial

  • Servlet HTTP client requests
    N Neo10101

    Concerning Servlets (spec 2.0): 1) What is the ideal methodology for handling client HTTP requests coming in for a servlet? - Using Threads? a) -> Is it not resource-heavy to have a million clients do a million requests at a time? b) -> Does this only lightly affect the CPU/memory/stability on the server? c) -> What methodology is used in real-world applications?

    Web Development question sysadmin performance learning

  • Must compile XAML file that specifies events
    N Neo10101

    No, I do not have the answer. The problem is not 'Must compile XAML that specifies events'. The problem is that Visual Studio does not accept XAML files that have Elements whose Background property is set. On my machine it is not compatible with the Background property for some reason. After I set any Background property on my XAML page and I run my project, Visual Studio will show a white page in my Accuracy.html. Everything is white. No content. I am trying to understand why Visual Studio does not accept this Background property.

    WPF javascript html css wpf

  • Must compile XAML file that specifies events
    N Neo10101

    When working with a XAML file in conjunction with JavaScript and HTML in VisualStudio, whenever I try to set the Loaded attribute in my Grid, my XAML page will fail to load. I get a blank screen and when I right click somewhere in the page, I see a little box saying 'Silverlight'. The JavaScript will also fail to execute. I get the following message when I try to open the page in Internet Explorer: "Must compile XAML that specifies events". Surprisingly, the other XAML page (Speeds.xaml) I have does not fail to execute the JS nor the XAML. It runs properly. Failing XAML file (Accuracy.xaml):

    Accuracy
    
    WPF javascript html css wpf
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups