Search Results

Search found 1724 results on 69 pages for 'belongs on superuser'.

Page 13/69 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Security approach in web application

    - by meep
    Hello everyone. I am designing a web application in ASP.NET / C# where each registered user has the ability to add/modify/delete rows based on their user-id. Take this example: I am going to edit my route on the page /route.aspx?routeid=854 which belongs to me (user-id: 1). But because I am a curious guy I try to access /route.aspx?routeid=855 which belongs to another user (user-id: 2). How can I best avoid people from accessing other peoples data? Should I send each user id (from session) with each database-call, should I validate user/password on every page load or what is the best and most secure approach? I hope I made this clear enough.

    Read the article

  • Returning references while using shared_ptrs

    - by Goose Bumper
    Suppose I have a rather large class Matrix, and I've overloaded operator== to check for equality like so: bool operator==(Matrix &a, Matrix &b); Of course I'm passing the Matrix objects by reference because they are so large. Now i have a method Matrix::inverse() that returns a new Matrix object. Now I want to use the inverse directly in a comparison, like so: if (a.inverse()==b) { ... }` The problem is, this means the inverse method needs to return a reference to a Matrix object. Two questions: Since I'm just using that reference in this once comparison, is this a memory leak? What happens if the object-to-be-returned in the inverse() method belongs to a boost::shared_ptr? As soon as the method exits, the shared_ptr is destroyed and the object is no longer valid. Is there a way to return a reference to an object that belongs to a shared_ptr?

    Read the article

  • Complicated conditional SQL query

    - by DevAno1
    I'm not even sure if it's possible but I need it for my Access database. So I have following db structure : Now I need to perform a query that takes category_id from my product and do the magic : - let's say product belongs to console (category_id is in table Console) - from console_types take type_id, where category_id == category_id - but if product belongs to console_game (category_id is in table console_game) - from console_game take game_cat_id, where category_id == category_id I'm not sure if mysql is capable of such thing. If not I'm really f&%ranked up. Maybe there is a way to split this into 2,3 separate queries ?

    Read the article

  • Relation/Sort not working in rails controller?

    - by Elliot
    I have the following relation in my rails app: genre - has many - authors authors - belong to genre and has many books books - belongs to authors and belongs to users (users can add books to the db) in my controller I have: @books=current_user.books(:include => [:author => :genre], :order => 'created_at DESC') While I am able to use the @books variable in my views - nothing is done correctly (i.e. its not showing me only books added by that user, and its not descending by created_at)... any ideas? -- Also I'm using clearance for the user auth, so current_user without the @ in the controller seems to work fine Actually, I think the relation is working, only the sort might not be working...

    Read the article

  • Rails: unexpected behavior updating a shared instance

    - by Pascal Lindelauf
    I have a User object, that is related to a Post object via two different association paths: Post --(has_many)-- comments --(belongs to)-- writer (of type User) Post --(belongs to)-- writer (of type User) Say the following hold: user1.name == "Bill" post1.comments[1].writer == user1 post1.writer == user1 Now when I retrieve the post1 and its comments from the database and I update post1.comments[1].writer like so: post1.comments[1].writer.name = "John" I would expect post1.writer to equal "John" too. But it doesn't! It still equals "Bill". So there seems to be some caching going on, but the kind I would not expect. I would expect Rails to be clever enough to load exactly one instance of the user with name "Bill"; instead is appears to load two individual ones: one for each association path. Can someone explain how this works exactly and how I am to handle these types of situations the "Rails way"?

    Read the article

  • has_many through and partials

    - by user307428
    I have a User model, a Post model, and an Interest model. Using User has_many posts through interests Using User has_many interests Using Post has_many users through interests Using Post has_many interests Using Interest belongs to Post Using Interest belongs to User Application_Controller is as follows: class ApplicationController < ActionController::Base before_filter :login_from_cookie before_filter :find_user_interests helper :all # include all helpers, all the time session :session_key = '_blah_session' include AuthenticatedSystem def find_user_interests @user_interests = current_user ? current_user.interests : [] true end Application.html.erb has as follows: <%= render :partial = "users/interests", :object = @user_interests % _interests.html.erb partial is as follows: ul <% unless current_user.nil? then -% <% @user_interests.each do |interest| -% li<%= interest.post.title %/li <% end % <% end -% /ul Given all this when I at localhost:3000/posts/1 my partial shows up fine, but when in localhost:3000/posts I get an error "undefined method `title' for nil:NilClass" thus an error in the line li<%= interest.post.title %/li shown above in the _interests.html.erb partial. What the heck would be the issue? TIA end

    Read the article

  • Extracting data points from a matrix and saving them in different matrixes in MATLAB

    - by Hossein
    Hi, I have a 2D Matrix consisting of some coordinates as below(example): Data(X,Y): 45.987543423,5.35000964 52.987544223,5,98765234 Also I have an array consisting of some integers =0 , for example: Cluster(M) 2,0,3,1 each of these numbers in this array corresponds with a row of my 2D Matrix above.For example, it says that row one(coordinate) in the Data Matirx belongs to the cluster 2,second row belongs to cluster 0 and so on. Now I want to have each of the datapoint of each cluster in a separate matrix, for example I want to save datapoints belonging to cluster 1 in a separate matrix, cluster 2 in a separate matrix and so on,.... I can do them manually, but the problem is this has to be an automatic extraction. which means that the number of clusters(range of the numbers in the cluster array varies in each run) so I have to have a general algorithm that does this extraction for me. Can someone help me please? thanks

    Read the article

  • How to solve this Java type safety warning? (Struts2)

    - by Nicolas Raoul
    Map session = ActionContext.getContext().getSession(); session.put("user", user); This code generates a warning: Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map should be parameterized. Map<String, Serializable> session = (Map<String, Serializable>)ActionContext.getContext().getSession(); session.put("user", user); This code generates a warning: Type safety: Unchecked cast from Map to Map. The getSession method belongs to Struts2 so I can't modify it. I would like to avoid using @SuppressWarnings because other warnings can be useful. I guess all Struts2 users in the world faced the same problem... is there an elegant solution?

    Read the article

  • SQL Alchemy: Relationship with grandson

    - by giomasce
    I'm building a SQL Alchemy structure with three different levels of objects; for example, consider a simple database to store information about some blogs: there are some Blog object, some Post object and some Comment objects. Each Post belongs to a Blog and each Comment belongs to a Post. Using backref I can automatically have the list of all Posts belonging to a Blog and similarly for Comments. I drafted a skeleton for such a structure. What I would like to do now is to have directly in Blog an array of all the Comments belonging to that Blog. I've tried a few approaches, but they don't work or even make SQL Alchemy cry in ways I can't fix. I'd think that mine is quite a frequent need, but I couldn't find anything helpful. Colud someone suggest me how to do that? Thanks.

    Read the article

  • When does logic belong in the Business Object/Entity, and when does it belong in a Service?

    - by Casey
    In trying to understand Domain Driven Design I keep returning to a question that I can't seem to definitively answer. How do you determine what logic belongs to a Domain entity, and what logic belongs to a Domain Service? Example: We have an Order class for an online store. This class is an entity and an aggregate root (it contains OrderItems). Public Class Order:IOrder { Private List<IOrderItem> OrderItems Public Order(List<IOrderItem>) { OrderItems = List<IOrderItem> } Public Decimal CalculateTotalItemWeight() //This logic seems to belong in the entity. { Decimal TotalWeight = 0 foreach(IOrderItem OrderItem in OrderItems) { TotalWeight += OrderItem.Weight } return TotalWeight } } I think most people would agree that CalculateTotalItemWeight belongs on the entity. However, at some point we have to ship this order to the customer. To accomplish this we need to do two things: 1) Determine the postage rate necessary to ship this order. 2) Print a shipping label after determining the postage rate. Both of these actions will require dependencies that are outside the Order entity, such as an external webservice to retrieve postage rates. How should we accomplish these two things? I see a few options: 1) Code the logic directly in the domain entity, like CalculateTotalItemWeight. We then call: Order.GetPostageRate Order.PrintLabel 2) Put the logic in a service that accepts IOrder. We then call: PostageService.GetPostageRate(Order) PrintService.PrintLabel(Order) 3) Create a class for each action that operates on an Order, and pass an instance of that class to the Order through Constructor Injection (this is a variation of option 1 but allows reuse of the RateRetriever and LabelPrinter classes): Public Class Order:IOrder { Private List<IOrderItem> OrderItems Private RateRetriever _Retriever Private LabelPrinter _Printer Public Order(List<IOrderItem>, RateRetriever Retriever, LabelPrinter Printer) { OrderItems = List<IOrderItem> _Retriever = Retriever _Printer = Printer } Public Decimal GetPostageRate { _Retriever.GetPostageRate(this) } Public void PrintLabel { _Printer.PrintLabel(this) } } Which one of these methods do you choose for this logic, if any? What is the reasoning behind your choice? Most importantly, is there a set of guidelines that led you to your choice?

    Read the article

  • Virtual String Tree - Display subnode when parent node is hidden

    - by daemon_x
    Is there a way to show subnode if the parent node is hidden in the Virtual String Tree ? I have some tasks in the tree structure and I wish to display only tasks which belongs to the current user as the list, but from all levels. What I've done is the function to display a list, which hides tree buttons, tree lines, sets the fixed indent and enable toShowHiddenNodes option. Then in this function I iterate through the whole tree (all levels) and hide nodes which doesn't belong to the current user IsVisible[Node] := False and show those which belongs him IsVisible[Node] := True, but the subnodes which should be displayed are invisible when their parent is hidden. VT.TreeOptions.PaintOptions - toShowButtons - toShowTreeLines + toFixedIndent + toShowHiddenNodes

    Read the article

  • OBject access from different functions in VC++

    - by sijith
    Hi, I have 3 function in my class B. These three function have to access member function of other class A. I did this by creating object of class A in class B constructor and tried to access that object in functions of class B. But its showing error. How can i assess the same object in these three functions. Where i have to create object of class A B::B() { A a; } B:: function() { a.fun(); //fun belongs to class A } B:: function1() { a.fun1(); //fun1 belongs to class A } I am getting error, How can i implement the same where i can access object a in both function.

    Read the article

  • Change master table PK and update related table FK (changing PK from Autoincrement to UUID on Mysql)

    - by eleonzx
    I have two related tables: Groups and Clients. Clients belongs to Groups so I have a foreign key "group_id" that references the group a client belongs to. I'm changing the Group id from an autoincrement to a UUID. So what I need is to generate a UUID for each Group and update the Clients table at once to reflect the changes and keep the records related. Is there a way to do this with multiple-table update on MySQL? Adding tables definitions for clarification. CREATE TABLE `groups` ( `id` char(36) NOT NULL, `name` varchar(255) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$ CREATE TABLE `clients` ( `id` char(36) NOT NULL, `name` varchar(255) NOT NULL, `group_id` char(36) DEFAULT NULL, `active` tinyint(1) DEFAULT '1' PRIMARY KEY (`id`), KEY `fkgp` (`group_id`), CONSTRAINT `fkgp` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$

    Read the article

  • Understanding Eager Loading & How to use it? (specific issue)

    - by Elliot
    I have the following relation in my rails app: genre - has many - authors authors - belong to genre and has many books books - belongs to authors and belongs to users (users can add books to the db) in my controller I have: @books=current_user.books(:include => [:author => :genre], :order => 'books.created_at DESC')--- -- In my controller I used to have: @authors = Author.All @genres = Genre.All etc. -- In my view I have @genres.each do |genre| @authors.each do |author| if author.genre_id == genre.id stuff end end end Now that I'm using eager loading, I can't imagine this is the best way to do this (nor does it work as I don't have the @ variables) - I was wondering if anyone could shed some light on how to approach this?

    Read the article

  • Examples of MMOs with small dev teams

    - by Aliud Alius
    I'd like to see a list of MMOs with small development teams in order to better understand where small teams have found a place for themselves. While examples of MMORPGs are of interest, so are games focusing on socializing, trade and commerce, city or empire building, crafting, exploration, strategy and so on. Any shipping game supporting between, say 800 and 10,000 simultaneous players belongs on this list. Thanks.

    Read the article

  • What do you do before you start programming?

    - by SterAllures
    Heya, I'm not sure this question belongs here, it's not so much I problem I'm having with programming but rather a problem of what to do before I start programming. I want a visual representation of what variables I need and what classes have what methods.I know there is UML but I'm not sure if that is the best way, so what do you guys use before you start programming, which method? I don't want to start a flamewar about what is better just what are several approaches?

    Read the article

  • BPM ADF Task forms. Checking whether the current user is in a BPM Swimlane

    - by Christopher Karl Chan
    So this blog will focus on BPM Swimlane roles and users from a ADF context.So we have an ADF Task Details Form and we are in the process of making it richer and dynamic in functionality. A common requirement could be to dynamically show different areas based on the user logged into the workspace. Perhaps even we want to know even what swim-lane role the user belongs to.It is is a little bit harder to achieve then one thinks unless you know the trick. [Read More]

    Read the article

  • BPM ADF Task forms. Checking whether the current user is in a BPM Swimlane

    - by Christopher Karl Chan
    @page { margin: 0.79in } P { margin-bottom: 0.08in } --Focus So this blog entry will focus on BPM Swimlane roles and users from a ADF context. So we have an ADF Task Details Form and we are in the process of making it richer and dynamic in functionality. A common requirement could be to dynamically show different areas based on the user logged into the workspace. Perhaps even we want to know even what swim-lane role the user belongs to. It is is a little bit harder to achieve then one thinks unless you know the trick. The Challenge The tricky part here is that the ADF Task Details Form is in fact part of a separate J2EE application to the main workspace. So if you try to use Java or Expression Language to get the logged in user you will only find anonymous and none of the BPM Roles you will be expecting. So what to do? The Magic First add the BC4J Security library to your view project. Then Restart JDeveloper. Now find the web.xml file in the view project of your ADF Task Details Application and look for the JpsFilter section. Then add in the following section. <init-param> <param-name>application.name</param-name> <param-value>OracleBPMProcessRolesApp</param-value></init-param> This will link your application to that of the BPM workspace. Then in your dynamic part of your ADF form you can now check whether the user logged into the BPM Workspace belongs in a BPM swim-lane in any BPM process. The best way to do this is by using expression language in the JSF page itself. Here I am simply changing the rendered flag to either true or false and thereby hiding or showing a section. Perhaps you are re-using the same form for a task in an approver swim-lane and ordinary user swimlane. So we only want the approver to see this field. So call the built in function to check if the user is a member of the BPM swim-lane role. The name of the role must be of the syntax BPMProject.RoleName <af:outputText value="This will only be rendered when the user is part of the BPM Swimlane Role rendered="#{securityContext.userInRole['BPMProjectName.Rolename']}"/> Now you must redeploy your ADF Task Form project Now (in the image above) the text will ONLY get rendered in the Task Details Form only if the user logged into the workspace is a member of the swimlane Unsecure of the BPM project SimpleTask

    Read the article

  • How to boot Chromebook from SD card without entering developer mode?

    - by Caleb Strutz
    I have a question. Is it at all possible to install Ubuntu or Chrubuntu onto a SD Card and then boot a chromebook from said SD card? I know this is easily possible, but the chromebook in question belongs to my school, so I cannot enter developer mode, because that would void the license agreement. I don't really care how technical or how many steps this will take, as long as it can be possible. Thanks in advance.

    Read the article

  • Using copyrighted sprites

    - by Zertalx
    I was thinking about making a pacman clone, I know there is a similar question here Using Copyrighted Images , but I know i can't use the original art from the game because it belongs to Namco, so if I design a character that has the shape of the slice circle it will look exactly like pacman, maybe if I use green instead of yellow? Also if the game plays like the original pacman, it is wrong? I just want to make the game as a personal project and and publish it in my site without getting in trouble

    Read the article

  • Turbocharge OpenOffice.org Writer with AuthorSupportTool

    <b>Worldlabel:</b> "The AuthorSupportTool (AST) extension belongs to the latter category. AST not just adds some random features to OpenOffice.org Writer, it dramatically enhances the word processor&#8217;s functionality, turning it into a powerful tool for working on research papers and complex documents."

    Read the article

  • Defining a service layer: the text-based adventure

    - by Stacy Vicknair
    Applications these days have more options than ever for a user interface, and it’s only going to grow. A successful product might require native applications for mobile devices, a regular web implementation, or even a gaming console. These systems often will be centralized and data driven. The solution is one that’s fairly solitary, a service layer! Simply put, take what’s shared and put it behind a physical or abstract layer that defines the boundary between the specific user interface and the shared content.   I know, I know, none of this is complicated. But some times it can be difficult to discern what belongs on which side of the line. For instance, say we’re creating a service that will provide content for both an ASP.NET MVC application and a WP7 application. Although the content served to each application is the same, there are different paradigms and patterns for displaying that data in the different environments. In ASP.NET MVC, you may create a model specific to a page that combines necessary information. In the WP7 application you might require different sets of data that you will connect via MVVM with the view. The general rule of thumb is that any shared content, business rules, or data should exist separately. Any element that is specific to the current UI implementation should be included in a separate library or with the UI implementation itself. The WP7 application doesn’t need my MVC specific model classes. My MVC application doesn’t require those INotifyPropertyChanged viewmodels that the WP7 application depends on. In both cases, there should be additional processing done above the service layer to massage the data to the application’s specific needs.   Service-ocalypse: the text based adventure What helps me the most about deciding whether or not something belongs coupled to the UI implementation or in the shared implementation is thinking of the simplest implementation you could have: a console application. You might have played a game like Peasant’s Quest: The console app is the text based adventure game version of your application. If you’re service was consumed in its simplest form, you would simply have a console based API for it that issues requests. Maybe those requests aren’t SWIM TO BOAT, but they might be CREATE USER JOHN. If I issue a request, I expect that request to be issued to the service. If the service has any exceptions or issues with my input, that business logic should be encapsulated in that service, not implemented in the UI. The service layer should be your functional application in its entirety, and anything above that layer should only assist with the display of that information.

    Read the article

  • Same product name in different categories

    - by Shawn
    I have two questions about URL structure for SEO. I have one product belongs to multiple categories. Is this OK for SEO OR shall I give them different product names? http://example.com/shirts/denim/poloshirt.html http://example.com/shirts/pinkcolor/poloshirt.html Is it good or to put numeric product code in the URL as this: http://example.com/shirts/denim/shirt-st397.html http://example.com/shirts/denim/shirt-sw160.html Google regard it as one product or different products?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >