Search Results

Search found 16568 results on 663 pages for 'warning level'.

Page 51/663 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • How do large sites accomplish row-level permissions?

    - by JayD3e
    So I am making a small site using cakephp, and my ACL is set up so that every time a piece of content is created, an ACL rule is created to link the owner of the piece of content to the actual content. This allows each owner to edit/delete their own content. This method just seems so inefficient, because there is an equivalent amount of ACL rules as content in the database. I was curious, how do big sites, with millions of pieces of content, solve this problem?

    Read the article

  • What are the different experience level for a technology

    - by Gunner
    Someone just starting to learn a technology is referred to as a beginner. But what are the various levels in terms of experience. I have seen Beginner, Intermediate, Expert being used. But is there just these three levels, or there are more, that is further break up. Is there any agreed standard to quantify experience levels.

    Read the article

  • hibernate distributed 2nd level cache options

    - by ishmeister
    Not really a question but I'm looking for comments/suggestions from anyone who has experiences using one or more of the following: EhCache with RMI EhCache with JGroups EhCache with Terracotta Gigaspaces Data Grid A bit of background: our applications is read only for the most part but there is some user data that is read-write and some that is only written (and can also be reasonably inaccurate). In addition, it would be nice to have tools that enable us to flush and fill the cache at intervals or by admin intervention. Regarding the first option - are there any concerns about the overhead of RMI and performance of Java serialization?

    Read the article

  • Higher level database layer for Android?

    - by sweetiecakes
    Are there any good database abstraction layers/object relational mappers/ActiveRecord implementations/whatever they are called for Android? I'm aware that db4o is officially supported, but it has quite a large footprint and I'd rather use a more conventional database (SQLite).

    Read the article

  • DOM Level 3 CustomEvents not bubbling on WebKit

    - by Edu Felipe
    I'm observing CustomEvents not bubbling, even though I set bubbling to true. The code below: var evt = document.createEvent("CustomEvent") evt.initCustomEvent("mycustomevent", true, false) var someh1 = document.getElementById("someh1") someh1.addEventListener("mycustomevent", function(){ alert("OMG!"); }) document.getElementsByTagName("body")[0].dispatchEvent(evt) With the HTML below: <html> <head></head> <body> <h1 id="someh1">content!</h1> </body> </html> Never shows the alert, demonstrating that the event is not bubbling down. Am I doing something wrong? Please note that if I do a getElementById("someh1") and run the dispatchEvent on it, the alert is displayed. Thanks!

    Read the article

  • XAML Multi-Level Binding Source/Path Issue

    - by tpartee
    So I have this issue I've been trying various ways to tackle all day and nothing's catching and working for it. Basically I have a XAML object called ChromeWindow (derived from Window) which has in it's code-behind a DependencyProperty called AppChrome which stores a reference to an associated ApplicationChrome XAML object (derived from UserControl). ApplicationChrome's XAML file has a few x:Name'd objects (a TextBlock and Border for instance) to which I want to bind to from the ChromeWindow's XAML. The root of the ChromeWindow is x:Name'd as 'rootWindow' in the XAML, so I figured one of these bindings would work: {Binding ElementName=rootWindow, Path=AppChrome.CaptionTextBlock.Text, Mode=OneWay} But that complains of a BindingExpression path error such that the property 'CaptionTextBlock' (an x:Name'd TextBlock in AppChrome's XAML) cannot be found on object of type ApplicationChrome So I tried this binding intead: {Binding Source=AppChrome.CaptionTextBlock, Path=Text, Mode=OneWay} And still no luck, this time complaints of a BindingExpression path error again, but this time that it cannot find the 'CaptionTextBlock' property on object of type String I know I'm missing something really simple here, please help! ;D

    Read the article

  • Spring deployment-level configuration

    - by Robert Wilson
    When I wrote JEE apps, I used JBoss Datasources to control which databases the deployment used. E.g. the dev versions would use a throwaway hibernate db, the ref and ops would use stable MySQL deployments. I also used MBeans to configure various other services and rules. Now that I'm using Spring, I'd like the same functionality - deploy the same code, but with different configuration. Crucially, I'd also like Unit Tests to still run with stub services. My question is this - is there a way, in JBoss, to inject configuration with files which live outside of the WAR/EAR, and also include these files in test resources.

    Read the article

  • CakePHP 3-level-deep model associatons

    - by user357452
    Hi, I am relatively new to CakePHP, I am doing fine with the documentation, but I've been trying to find a way out to this problem for weeks and I don't seem to find the solution, I am sure it is easy and maybe even automagicaly doable, but I just don't know how to find it (maybe I don't know the jargon for these kind of things) My model structure is like this: <?php class Trip extends AppModel { var $belongsTo = array( 'User' => array( 'className' => 'User', 'foreignKey' => 'user_id' ), 'Start' => array( 'className' => 'Place', 'foreignKey' => 'start_id' ), 'End' => array( 'className' => 'Place', 'foreignKey' => 'end_id' ), 'Transport' => array( 'className' => 'Transport', 'foreignKey' => 'transport_id' ) ); } ?> <?php class Place extends AppModel { var $belongsTo = array( 'User' => array( 'className' => 'User', 'foreignKey' => 'user_id' ), 'Country' => array( 'className' => 'Country', 'foreignKey' => 'country_id' ), 'State' => array( 'className' => 'State', 'foreignKey' => 'state_id' ), 'City' => array( 'className' => 'City', 'foreignKey' => 'city_id' ) ); var $hasMany = array( 'PlaceStart' => array( 'className' => 'trip', 'foreignKey' => 'start_id', 'dependent' => false ), 'PlaceEnd' => array( 'className' => 'trip', 'foreignKey' => 'end_id', 'dependent' => false ) ); } ?> <?php class State extends AppModel { var $belongsTo = array( 'Country' => array( 'className' => 'Country', 'foreignKey' => 'country_id', 'conditions' => '', 'fields' => '', 'order' => '' ) ); var $hasMany = array( 'City' => array( 'className' => 'City', 'foreignKey' => 'city_id', 'dependent' => false ) ); } ?> ... and so forth with User, City, Country, and Transport Models. What I am trying to achieve is to get all the information of the whole tree when I search for a Trip. <?php class TripController extends AppController { function index() { debug($this->Trip->find('first')); } } Outputs Array ( [Trip] => Array ( [id] => 6 [created] => 2010-05-04 00:23:59 [user_id] => 4 [start_id] => 2 [end_id] => 1 [title] => My trip [transport_id] => 1 ) [User] => Array ( [id] => 4 [name] => John Doe [email] => [email protected] ) [Start] => Array ( [id] => 2 [user_id] => 4 [country_id] => 1 [state_id] => 1 [city_id] => 1 [direccion] => Lincoln Street ) [End] => Array ( [id] => 1 [user_id] => 4 [country_id] => 1 [state_id] => 1 [city_id] => 4 [address] => Fifth Avenue ) [Transport] => Array ( [id] => 1 [name] => car ) ) Here is the question: How do I get in one query all the information down the tree? I would like to have something like Array ( [Trip] => Array ( [id] => 6 [created] => 2010-05-04 00:23:59 [User] => Array ( [id] => 4 [name] => John Doe [email] => [email protected] ) [Start] => Array ( [id] => 2 [user_id] => 4 [Country] => Array ( [id] => 1 [name] = Spain ) [State] => Array ( [id] => 1 [name] = Barcelona ) [City] => Array ( [id] => 1 [name] = La Floresta ) [address] => Lincoln Street ) [End] => (same as Start) [title] => My trip [Transport] => Array ( [id] => 1 [name] => car ) ) ) Can CakePHP create this kind of data? Not only for $this->Model->find() but also for $this->paginate() as for example: // filter by start if(isset($this->passedArgs['start'])) { //debug('isset '.$this->passedArgs['start']); $start = $this->passedArgs['start']; $this->paginate['conditions'][] = array( 'OR' => array( 'Start.address LIKE' => "%$start%", 'Start.State.name LIKE' => "%$start%", 'Start.City.name LIKE' => "%$start%", 'Start.Country.name LIKE' => "%$start%" ) ); $this->data['Search']['start'] = $start; } It seems like a rough question but I am sure this is extensively done and documented, I'd really appreciate any help. Thanks Cheers Naoise

    Read the article

  • Simulating a 2-level If-Else using RewriteCond

    - by hlissner
    Hi! I'm trying to get my head around RewriteCond, and want to rewrite any requests either to a static html page (if it exists), or to a specific index.php (so long as the requested file doesn't exist). To illustrate the logic: if HTTP_HOST is '(www\.)?mydomain.com' if file exists: "/default/static/{REQUEST_URI}.html", then rewrite .* to /default/static/{REQUEST_URI}.html else if file exists: {REQUEST_FILENAME}, then do not rewrite else rewrite .* to /default/index.php I don't seem to have much trouble doing it when I don't need to test for the HTTP_HOST. Ultimately, this one .htaccess file will be handling requests for several domains. I know I could get around this with vhosts, but I'd like to figure out how to do it this way. Here's where I am at now: RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.com$ [NC] RewriteCond /default/static/%{REQUEST_URI}.html -f RewriteRule . /default/static/%{REQUEST_URI}.html [L,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . /default/index.php [L,QSA] I'm not too familiar with some of the other flags, will any of them be of use here (like chain|C, next|N or skip|S)? Thanks in advance! UPDATE: I've managed to do it, but would appreciate alternatives: RewriteEngine On RewriteRule ^(.+)/$ /$1 [L] RewriteCond %{HTTP_HOST} ^(domainA|domainB)\.com [NC] RewriteCond %{DOCUMENT_ROOT}/%1/static/%{REQUEST_URI}.html -f RewriteRule (.*)? /%1/static/$1.html [NC,L] RewriteCond %{HTTP_HOST} ^(domainA|domainB)\.com [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* /%1/index.php [L,QSA]

    Read the article

  • Rails dealing with blank params at controller level

    - by stephenmurdoch
    I have a User model: class User < ActiveRecord::Base has_secure_password # validation lets users update accounts without entering password validates :password, presence: { on: :create }, allow_blank: { on: :update } validates :password_confirmation, presence: { if: :password_digest_changed? } end I also have a password_reset_controller: def update # this is emailed to the user by the create action - not shown @user=User.find_by_password_reset_token!(params[:id]) if @user.update_attributes(params[:user]) # user is signed in if password and confirmation pass validations sign_in @user redirect_to root_url, :notice => "Password has been reset." else flash.now[:error] = "Something went wrong, please try again." render :edit end end Can you see the problem here? A user can submit a blank a password/confirmation and rails will sign them in, because the User model allows blank on update. It's not a security concern, since an attacker would still need access to a user's email account before they could get anywhere near this action, but my problem is that a user submitting 6 blank chars would be signed in, and their password would not be changed for them, which could lead to confusion later on. So, I've come up with the following solution, and I'd like to check if there's a better way of doing it, before I push to production: def update @user=User.find_by_password_reset_token!(params[:id]) # if user submits blank password, add an error, and render edit action if params[:user][:password].blank? @user.errors.add(:password_digest, "can't be blank.") render :edit elsif @user.update_attributes(params[:user]) sign_in @user redirect_to root_url, :notice => "Password has been reset." else flash.now[:error] = "Something went wrong, please try again." render :edit end end Should I be checking for nil as well as blank? Are there any rails patterns or idiomatic ruby techniques for solving this? [Fwiw, I've got required: true on the html inputs, but want this handled server side too.]

    Read the article

  • Improved way to build nested array of unique values in javascript

    - by dualmon
    The setup: I have a nested html table structure that displays hierarchical data, and the individual rows can be hidden or shown by the user. Each row has a dom id that is comprised of the level number plus the primary key for the record type on that level. I have to have both, because each level is from a different database table, so the primary key alone is not unique in the dom. example: id="level-1-row-216" I am storing the levels and rows of the visible elements in a cookie, so that when the page reloads the same rows the user had open are can be shown automatically. I don't store the full map of dom ids, because I'm concerned about it getting too verbose, and I want to keep my cookie under 4Kb. So I convert the dom ids to a compact json object like this, with one property for each level, and a unique array of primary keys under each level: { 1:[231,432,7656], 2:[234,121], 3:[234,2], 4:[222,423], 5:[222] } With this structure stored in a cookie, I feed it to my show function and restore the user's previous disclosure state when the page loads. The area for improvement: I'm looking for better option for reducing my map of id selectors down to this compact format. Here is my function: function getVisibleIds(){ // example dom id: level-1-row-216-sub var ids = $("tr#[id^=level]:visible").map(function() { return this.id; }); var levels = {}; for(var i in ids ) { var id = ids[i]; if (typeof id == 'string'){ if (id.match(/^level/)){ // here we extract the number for level and row var level = id.replace(/.*(level-)(\d*)(.*)/, '$2'); var row = id.replace(/.*(row-)(\d*)(.*)/, '$2'); // *** Improvement here? *** // This works, but it seems klugy. In PHP it's one line (see below): if(levels.hasOwnProperty(level)){ if($.inArray(parseInt(row, 10) ,levels[level]) == -1){ levels[level].push(parseInt(row, 10)); } } else { levels[level] = [parseInt(row, 10)]; } } } } return levels; } If I were doing it in PHP, I'd build the compact array like this, but I can't figure it out in javascript: foreach($ids as $id) { if (/* the criteria */){ $level = /* extract it from $id */; $row = /* extract it from $id */; $levels[$level][$row]; } }

    Read the article

  • go up to 3 level dephth in hibernate criterion

    - by Satyajitsinh Raijada
    i am using hibernate criterion for fetching results. Here with i provided demo design of my persistence class. Class A{ private B b; } Class B{ private C c; } Class C{ private Long val; } assume these are the hibernate persistence classes i am not writing all annotations of mapping with database. now my problem is i want to retrieve results of Class A according to the value of Class C's val property. i tried to fetch it using, Criteria c = Restrictions.eq("b.c.val", value); List l = c.list; it shows could not resolve property. i searched and came to know criteria wont work up to this much depth. i don't want shift to HQL. any idea??

    Read the article

  • Ruby on rails 2 level model

    - by jony17
    I need some help creating a very simple forum in a existing model. What I want in a Game page, have a mini forum, where is possible create some topics and some comments to this topics. In the beginning I'm only implement topics. This is the error I have: Mysql2::Error: Column 'user_id' cannot be null: INSERT INTO `topics` (`game_id`, `question`, `user_id`) VALUES (1, 'asd', NULL) This is my main model: game.rb class Game < ActiveRecord::Base attr_accessible :name validates :user_id, presence: true validates :name, presence: true, length: { maximum: 50 } belongs_to :user has_many :topics, dependent: :destroy end topic.rb class Topic < ActiveRecord::Base validates_presence_of :question validates_presence_of :game_id attr_accessible :question, :user_id validates :question, length: {maximum: 50}, allow_blank: false belongs_to :game belongs_to :user end topic_controller.rb def create @game = Game.find(params[:game_id]) @topic = @game.topics.create(params[:topic]) @topic.user_id = current_user.id respond_to do |format| if @topic.save format.html { redirect_to @game, notice: 'Topic was successfully created.' } else format.html { render action: "new" } end end end game/show.html.erb <h2>Topics</h2> <% @game.topics.each do |topic| %> <p> <b>Question:</b> <%= topic.question %> </p> <% end %> <h2>Add a topic:</h2> <%= form_for([@game, @game.topics.build]) do |f| %> <div class="field"> <%= f.label :question %><br /> <%= f.text_field :question %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> Thanks ;)

    Read the article

  • Implement a top level window from a broadcast receiver

    - by kwatts
    I have a broadcast receiver that listens for incoming calls, then displays a popup. The popup is a dialog type of theme and has FLAG_NOT_FOCUSABLE and FLAG_NOT_TOUCHABLE - basically, it's an informational window that goes away after x seconds, and is not meant to interfere or take focus over anything else. The issue is that the incoming call intent, built into android, is getting the broadcast after my intent. This is causing that window to be stacked in front of mine. How to I get my window to always be on top? Thanks!

    Read the article

  • How can I provide property-level string formatting?

    - by jhubsharp
    Not sure if the question wording is accurate, but here's what I want to do: I want to databind a class with some strings in it: class MyClass { public string MyProperty { get; set; } public string MyProperty2 { get; set; } } When databinding, everything behaves normally. On the back end, I'm writing to a file and I want MyProperty2 to always be encrypted using some encryption algorithm. I want my back-end code to write each string without needing to know that encryption is required (I want the class to know it should be encrypted, not the consumer). Can I do this with a type converter, or something similar? EDIT: There are other scenarios as well. Some booleans I want to format as "Y" or "N", other booleans I want formatted as "Enabled" / "Disabled", etc. I can write (and have written) helper methods and let the file writer call the helper methods as appropriate, I'm just wondering if there's a way to do this without the file writer needing to know which objects need which kind of formatting and let the objects tell that to the file writer.

    Read the article

  • Camera crashes in android 4.1(API level 16)

    - by Lincy
    My application has a camera functionality. It works fine in all Android version but now when i tested in S3 it crashes. The error points to this line: Parameters parameters = mCamera.getParameters(); Could someone provide a solution for this? The log is below: ?:??: W/?(?): java.lang.NullPointerException ?:??: W/?(?): at com.stpl.snapshun.camera.CameraActivity.surfaceChanged(CameraActivity.java:313) ?:??: W/?(?): at android.view.SurfaceView.updateWindow(SurfaceView.java:554) ?:??: W/?(?): at android.view.SurfaceView.access$000(SurfaceView.java:81) ?:??: W/?(?): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:169) ?:??: W/?(?): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:671) ?:??: W/?(?): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1818) ?:??: W/?(?): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998) ?:??: W/?(?): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212) ?:??: W/?(?): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725) ?:??: W/?(?): at android.view.Choreographer.doCallbacks(Choreographer.java:555) ?:??: W/?(?): at android.view.Choreographer.doFrame(Choreographer.java:525) ?:??: W/?(?): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711) ?:??: W/?(?): at android.os.Handler.handleCallback(Handler.java:615) ?:??: W/?(?): at android.os.Handler.dispatchMessage(Handler.java:92) ?:??: W/?(?): at android.os.Looper.loop(Looper.java:137) ?:??: W/?(?): at android.app.ActivityThread.main(ActivityThread.java:4745) ?:??: W/?(?): at java.lang.reflect.Method.invokeNative(Native Method) ?:??: W/?(?): at java.lang.reflect.Method.invoke(Method.java:511) ?:??: W/?(?): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) ?:??: W/?(?): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) ?:??: W/?(?): at dalvik.system.NativeStart.main(Native Method) Thanks in advance

    Read the article

  • Are today's general purpose languages at the right level of abstarction ?

    - by KeesDijk
    Today Uncle Bob Martin, a genuine hero, showed this video In this video Bob Martin claims that our programming languages are at the right level for our problems at this time. One of the reasons I get from this video as that he Bob Martin sees us detail managers and our problems are at the detail level. This is the first time I have to disagree with Bob Martin and was wondering what the people at programmers think about this. First there is a difference between MDA and MDE MDA in itself hasn't worked and I blame way to much formalisation at a level you can't formalize these kind of problems. MDE and MDD are still trying to prove themselves and in my mind show great promise. e.g. look at MetaEdit The detail still needs to be management in my mind, but you do so in one place (framework or generators) instead of at multiple places. Right for our kind of problems ? I think depends on what problems you look at. Do the current programming languages keep up with the current demands on time to market ? Are they good at bridging the business IT communication gap ? So what do you think ?

    Read the article

  • Are today's general purpose languages at the right level of abstraction ?

    - by KeesDijk
    Today Uncle Bob Martin, a genuine hero, showed this video In this video Bob Martin claims that our programming languages are at the right level for our problems at this time. One of the reasons I get from this video as that Bob Martin sees us as detail managers and our problems are at the detail level. This is the first time I have to disagree with Bob Martin and was wondering what the people at programmers think about this. First there is a difference between MDA and MDE MDA in itself hasn't worked and I blame way to much formalisation at a level you can't formalize these kind of problems. MDE and MDD are still trying to prove themselves and in my mind show great promise. e.g. look at MetaEdit The detail still needs to be management in my mind, but you do so in one place (framework or generators) instead of at multiple places. Right for our kind of problems ? I think depends on what problems you look at. Do the current programming languages keep up with the current demands on time to market ? Are they good at bridging the business IT communication gap ? So what do you think ?

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >