Search Results

Search found 574 results on 23 pages for 'jeremy ramos'.

Page 16/23 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Flex LineChart with Multiple Data Providers

    - by Jeremy Mitchell
    Can I create a LineChart with multiple data providers? Since LineSeries has a dataprovider property, I'm assuming the answer is Yes. I would expect something like this to work: <LineChart>     <series>         <LineSeries dataprovider="{dp1}"/>         <LineSeries dataprovider="{dp2}"/>         <LineSeries dataprovider="{dp3}"/>     </series> </LineChart> But, the LineChart only appears to work for me when the dataprovider is assigned to the LineChart. Thanks.

    Read the article

  • How can I ensure that a Java object (containing cryptographic material) is zeroized?

    - by Jeremy Powell
    My concern is that cryptographic keys and secrets that are managed by the garbage collector may be copied and moved around in memory without zeroization. As a possible solution, is it enough to: public class Key { private char[] key; // ... protected void finalize() throws Throwable { try { for(int k = 0; k < key.length; k++) { key[k] = '\0'; } } catch (Exception e) { //... } finally { super.finalize(); } } // ... }

    Read the article

  • Rails validation count limit on has_many :through

    - by Jeremy
    I've got the following models: Team, Member, Assignment, Role The Team model has_many Members. Each Member has_many roles through assignments. Role assignments are Captain and Runner. I have also installed devise and CanCan using the Member model. What I need to do is limit each Team to have a max of 1 captain and 5 runners. I found this example, and it seemed to work after some customization, but on update ('teams/1/members/4/edit'). It doesn't work on create ('teams/1/members/new'). But my other validation (validates :role_ids, :presence = true ) does work on both update and create. Any help would be appreciated. Update: I've found this example that would seem to be similar to my problem but I can't seem to make it work for my app. It seems that the root of the problem lies with how the count (or size) is performed before and during validation. For Example: When updating a record... It checks to see how many runners there are on a team and returns a count. (i.e. 5) Then when I select a role(s) to add to the member it takes the known count from the database (i.e. 5) and adds the proposed changes (i.e. 1), and then runs the validation check. (Team.find(self.team_id).members.runner.count 5) This works fine because it returns a value of 6 and 6 5 so the proposed update fails without saving and an error is given. But when I try to create a new member on the team... It checks to see how many runners there are on a team and returns a count. (i.e. 5) Then when I select a role(s) to add to the member it takes the known count from the database (i.e. 5) and then runs the validation check WITHOUT factoring in the proposed changes. This doesn't work because it returns a value of 5 known runner and 5 = 5 so the proposed update passes and the new member and role is saved to the database with no error. Member Model: class Member < ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable attr_accessible :password, :password_confirmation, :remember_me attr_accessible :age, :email, :first_name, :last_name, :sex, :shirt_size, :team_id, :assignments_attributes, :role_ids belongs_to :team has_many :assignments, :dependent => :destroy has_many :roles, through: :assignments accepts_nested_attributes_for :assignments scope :runner, joins(:roles).where('roles.title = ?', "Runner") scope :captain, joins(:roles).where('roles.title = ?', "Captain") validate :validate_runner_count validate :validate_captain_count validates :role_ids, :presence => true def validate_runner_count if Team.find(self.team_id).members.runner.count > 5 errors.add(:role_id, 'Error - Max runner limit reached') end end def validate_captain_count if Team.find(self.team_id).members.captain.count > 1 errors.add(:role_id, 'Error - Max captain limit reached') end end def has_role?(role_sym) roles.any? { |r| r.title.underscore.to_sym == role_sym } end end Member Controller: class MembersController < ApplicationController load_and_authorize_resource :team load_and_authorize_resource :member, :through => :team before_filter :get_team before_filter :initialize_check_boxes, :only => [:create, :update] def get_team @team = Team.find(params[:team_id]) end def index respond_to do |format| format.html # index.html.erb format.json { render json: @members } end end def show respond_to do |format| format.html # show.html.erb format.json { render json: @member } end end def new respond_to do |format| format.html # new.html.erb format.json { render json: @member } end end def edit end def create respond_to do |format| if @member.save format.html { redirect_to [@team, @member], notice: 'Member was successfully created.' } format.json { render json: [@team, @member], status: :created, location: [@team, @member] } else format.html { render action: "new" } format.json { render json: @member.errors, status: :unprocessable_entity } end end end def update respond_to do |format| if @member.update_attributes(params[:member]) format.html { redirect_to [@team, @member], notice: 'Member was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @member.errors, status: :unprocessable_entity } end end end def destroy @member.destroy respond_to do |format| format.html { redirect_to team_members_url } format.json { head :no_content } end end # Allow empty checkboxes # http://railscasts.com/episodes/17-habtm-checkboxes def initialize_check_boxes params[:member][:role_ids] ||= [] end end _Form Partial <%= form_for [@team, @member], :html => { :class => 'form-horizontal' } do |f| %> #... # testing the count... <ul> <li>Captain - <%= Team.find(@member.team_id).members.captain.size %></li> <li>Runner - <%= Team.find(@member.team_id).members.runner.size %></li> <li>Driver - <%= Team.find(@member.team_id).members.driver.size %></li> </ul> <div class="control-group"> <div class="controls"> <%= f.fields_for :roles do %> <%= hidden_field_tag "member[role_ids][]", nil %> <% Role.all.each do |role| %> <%= check_box_tag "member[role_ids][]", role.id, @member.role_ids.include?(role.id), id: dom_id(role) %> <%= label_tag dom_id(role), role.title %> <% end %> <% end %> </div> </div> #... <% end %>

    Read the article

  • Zend Form - how do I create these custom form elements?

    - by Jeremy Hicks
    This is a very specific instance where I'm having difficulty getting Zend Form to produce the correct output and supply the correct validation. I may have to go create a composite element but thought I'd ask here first. Here is the HTML I'm trying to get Zend Form to produce. I'd like this to be able to work where if the validation doesn't pass that the error messages still show up inline with the field that produced the error. <tr> <td>Budget</td> <td> <input type="radio" name="budget" value="unlimited" /> unlimited <br /> <input type="radio" name="budget" value="limited" /> $ <input type="text" name="budget_amount" /> every <select name="budget_period"> <option value="day">day</option> <option value="week">week</option> <option value="month">month</option> <option value="year">year</option> </select> </td> </tr> <tr> <td></td> <td><input type="checkbox" name="include_weekends" value="yes" /> include weekends?</td> </tr> The user can choose either unlimited or limited for the budget value, however, if they choose limited, then they are required to enter a value for the budget amount field and choose a value from the select for the budget period field.

    Read the article

  • Game engine deployment strategy for the Android?

    - by Jeremy Bell
    In college, my senior project was to create a simple 2D game engine complete with a scripting language which compiled to bytecode, which was interpreted. For fun, I'd like to port the engine to android. I'm new to android development, so I'm not sure which way to go as far as deploying the engine on the phone. The easiest way I suppose would be to require the engine/interpreter to be bundled with every game that uses it. This solves any versioning issues. There are two problems with this. One: this makes each game app larger and two: I originally released the engine under the LGPL license (unfortunately), but this deployment strategy makes it difficult to conform to the rules of that license, particularly with respect to allowing users to replace the lib easily with another version. So, my other option is to somehow have the engine stand alone as an Activity or service that somehow responds to intents raised by game apps, and somehow give the engine app permissions to read the scripts and other assets to "run" the game. The user could then be able to replace the engine app with a different version (possibly one they made themselves). Is this even possible? What would you recommend? How could I handle it in a secure way?

    Read the article

  • Why does PHP overwrite values when I iterate through this array twice (by reference, by value)

    - by jeremy
    If I iterate through an array twice, once by reference and then by value, PHP will overwrite the last value in the array if I use the same variable name for each loop. This is best illustrated through an example: $array = range(1,5); foreach($array as &$element) { $element *= 2; } print_r($array); foreach($array as $element) { } print_r($array); Output: Array ( [0] = 2 [1] = 4 [2] = 6 [3] = 8 [4] = 10 ) Array ( [0] = 2 [1] = 4 [2] = 6 [3] = 8 [4] = 8 ) Note that I am not looking for a fix, I am looking to understand why this is happening. Also note that it does not happen if the variable names in each loop are not each called $element, so I'm guessing it has to do with $element still being in scope and a reference after the end of the first loop.

    Read the article

  • What processor is javax.xml.transform Using?

    - by Jeremy Witmer
    I've implented a simple webapp that transforms XML based on an XSTL stylesheet. It works fine on all the Windows servers I've deployed it on (to Tomcat), but on all Linux systems, I get a compile error on the XSLT. As best I can tell, it's because Java 1.6 isn't using the same processor behind javax.xml.transform. On the one Linux system, it's org.apache.xalan.xslt, version 2.4. What I can't figure out is how to generically figure out what any given system is using behind javax.xml.transform. Or, if anyone has any hints on what else I might do to figure out the problem, that'd be good, too.

    Read the article

  • float change from python 3.0.1 to 3.1.2

    - by Jeremy
    Im trying to learn python. I am using 3.1.2 and the o'reilly book is using 3.0.1 here is my code import urllib.request price = (99.99) while price 4.74: page = urllib.request.urlopen ("http://www.beans-r-us.biz/prices-loyalty.html") text = page.read().decode("utf8") where = text.find('>$') start_of_price = where + 2 end_of_price = start_of_price + 6 price = float(text[start_of_price:end_of_price]) print ("Buy!") - here is my error Traceback (most recent call last): File "/Users/odin/Desktop/Coffe.py", line 14, in price = float(text[start_of_price:end_of_price]) ValueError: invalid literal for float(): 4.59 what is wrong? please help!!

    Read the article

  • In a class with no virtual methods or superclass, is it safe to assume (address of first member vari

    - by Jeremy Friesner
    Hi all, I made a private API that assumes that the address of the first member-object in the class will be the same as the class's this-pointer... that way the member-object can trivially derive a pointer to the object that it is a member of, without having to store a pointer explicitly. Given that I am willing to make sure that the container class won't inherit from any superclass, won't have any virtual methods, and that the member-object that does this trick will be the first member object declared, will that assumption hold valid for any C++ compiler, or do I need to use the offsetof() operator (or similar) to guarantee correctness? To put it another way, the code below does what I expect under g++, but will it work everywhere? class MyContainer { public: MyContainer() {} ~MyContainer() {} // non-virtual dtor private: class MyContained { public: MyContained() {} ~MyContained() {} // Given that the only place Contained objects are declared is m_contained // (below), will this work as expected on any C++ compiler? MyContainer * GetPointerToMyContainer() { return reinterpret_cast<MyContainer *>(this); } }; MyContained m_contained; // MUST BE FIRST MEMBER ITEM DECLARED IN MyContainer int m_foo; // other member items may be declared after m_contained float m_bar; };

    Read the article

  • relative url in wcf service binding

    - by Jeremy
    I have a silverlight control which has a reference to a silverlight enabled wcf service. When I add a reference to the service in my silverlight control, it adds the following to my clientconfig file: <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_DataAccess" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:3097/MyApp/DataAccess.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_DataAccess" contract="svcMyService.DataAccess" name="BasicHttpBinding_DataAccess" /> </client> </system.serviceModel> </configuration> How do I specify a relative url in the endpoint address instead of the absolute url? I want it to work no matter where I deploy the web app to without having to edit the clientconfig file, because the silverlight component and the web app will always be deployed together. I thought I'd be able to specify just "DataAccess.svc" but it doesn't seem to like that.

    Read the article

  • How to make NSView not clip its bounding area?

    - by Jeremy L
    I created an empty Cocoa app on Xcode for OS X, and added: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { self.view = [[NSView alloc] initWithFrame:NSMakeRect(100, 100, 200, 200)]; self.view.wantsLayer = YES; self.view.layer = [CALayer layer]; self.view.layer.backgroundColor = [[NSColor yellowColor] CGColor]; self.view.layer.anchorPoint = CGPointMake(0.5, 0.5); self.view.layer.transform = CATransform3DMakeRotation(30 * M_PI / 180, 1, 1, 1); [self.window.contentView addSubview:self.view]; } But the rotated layer's background is clipped by the view's bounding area: I thought since some version of OS X and iOS, the view won't clip the content of its subviews and will show everything inside and outside? On iOS, I do see that behavior, but I wonder why it shows up like that and how to make everything show? (I am already using the most current Xcode 4.4.1 on Mountain Lion). (note: if you try the code above, you will need to link to Quartz Core, and possibly import the quartz core header, although I wonder why I didn't import the header and it still compiles perfectly)

    Read the article

  • LINQ to SQL stored procedures with multiple results in Visual Studio 2008

    - by Jeremy
    I'm using visual studio 2008 and I've created a stored procedure that selects back two different result sets. I drag the stored proc on to a linq to sql dbml datacontext class, causing visual studio to create the following code in the cs file: [Function(Name="dbo.List_MultiSelect")] public ISingleResult<DataAccessLayer.DataEntities.List_MultiSelectResult> List_MultiSelect() { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod()))); return ((ISingleResult<DataAccessLayer.DataEntities.List_MultiSelectResult>)(result.ReturnValue)); } Shouldn't the designer generate the code to use IMultipleResults? Or do I have to hand code that?

    Read the article

  • Correct Delphi compiler switches to stop in the user's code, not my component's

    - by Jeremy Mullin
    I'm modifying our VCL components so the end user's application links to our dcu files, instead of building our source code each time. We have everything working, but I want the debugger to stop on the user's code when an exception is raised. At first it would stop in our dcu and open the CPU window. I was able to prevent that by removing debug info from the dcu files. But now it still doesn't stop in the users code (like DevExpress libraries and others do). The following screencast is a short example. The first time I cause an exception in the DevExpress code, and the debugger correctly stops in my button event. The second time I cause an exception in my components, but the debugger doesn't have my button event on the call stack, and doesn't show me where the problem was. Any ideas why? http://screencast.com/t/NjhlOTRk Currently building the DCU's with these options: -$W+ -$D- -h -w -q Update: The TDataSet methods in between my component and the button event seem to cause this behavior. If I instead call a direct method of my table, I get the expected behavior. I'm guessing there isn't anything I can do about this, but I'm still curious why it happens.

    Read the article

  • Open HTML meta redirect in new window

    - by Jeremy Person
    I need web page to redirect via HTML meta and open that page in a new window. How can I do that? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Photo Gallery Redirect</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Refresh" content="0; url=http://google.com> </head> <body> </body> </html>

    Read the article

  • Linq with a long where clause

    - by Jeremy Roberts
    Is there a better way to do this? I tried to loop over the partsToChange collection and build up the where clause, but it ANDs them together instead of ORing them. I also don't really want to explicitly do the equality on each item in the partsToChange list. var partsToChange = new Dictionary<string, string> { {"0039", "Vendor A"}, {"0051", "Vendor B"}, {"0061", "Vendor C"}, {"0080", "Vendor D"}, {"0081", "Vendor D"}, {"0086", "Vendor D"}, {"0089", "Vendor E"}, {"0091", "Vendor F"}, {"0163", "Vendor E"}, {"0426", "Vendor B"}, {"1197", "Vendor B"} }; var items = new List<MaterialVendor>(); foreach (var x in partsToChange) { var newItems = ( from m in MaterialVendor where m.Material.PartNumber == x.Key && m.Manufacturer.Name.Contains(x.Value) select m ).ToList(); items.AddRange(newItems); } Additional info: I am working in LINQPad.

    Read the article

  • Resize my Google Map API

    - by Jeremy Flaugher
    I am new to JS, and have found the answer to a previous question, which brought up a new question, which brought me here again. I have a Reveal Modal that contains a Google Map API. When a button is clicked, the Reveal Modal pops up, and displays the Google Map. My problem is that only a third of the map is displaying. This is because a resize trigger needs to be implemented. My question is how do I implement the google.maps.event.trigger(map, 'resize')? Where do I place this little snippet of code? The Reveal Model script: <script type="text/javascript"> $(document).ready(function() { $('#myModal1').click(function() { $('#myModal').reveal(); }); }); </script> My Google Map Script: <script type="text/javascript"> function initialize() { var mapOptions = { center: new google.maps.LatLng(39.739318, -89.266507), zoom: 5, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); } </script> The div which holds the Google Map: <div id="myModal" class="reveal-modal large"> <h2>How to get here</h2> <div id="map_canvas" style="width:600px; height:300px;"></div> <a class="close-reveal-modal">&#215;</a> </div>

    Read the article

  • Setting property default values for a Web User Control

    - by Jeremy Holland
    I am trying to build a web user control and set some default values for its properties in the code-behind like this: [DefaultValue(typeof(int), "50")] public int Height { get; set; } [DefaultValue(typeof(string), "string.Empty")] public string FamilyName { get; set; } [DefaultValue(typeof(Color), "Orange")] public System.Drawing.Color ForeColor { get; set; } When I add the user control to the page and call it without any properties: <uc1:Usercontrol ID="uc" runat="server" /> the default values are not set and every property is 0 or null. What am I doing wrong? Thanks.

    Read the article

  • Best Way to View Generated Source of Webpage?

    - by jeremy
    I'm looking for a tool that will give me the proper generated source including DOM changes made by AJAX requests for input into W3's validator. I've tried the following methods: Web Developer Toolbar - Generates invalid source according to the doc-type (e.g. it removes the self closing portion of tags). Loses the doctype portion of the page. Firebug - Fixes potential flaws in the source (e.g. unclosed tags). Also loses doctype portion of tags and injects the console which itself is invalid HTML. IE Developer Toolbar - Generates invalid source according to the doc-type (e.g. it makes all tags uppercase, against XHTML spec). Highlight + View Selection Source - Frequently difficult to get the entire page, also excludes doc-type. Is there any program or add-on out there that will give me the exact current version of the source, without fixing or changing it in some way? So far, Firebug seems the best, but I worry it may fix some of my mistakes. Solution It turns out there is no exact solution to what I wanted as Justin explained. The best solution seems to be to validate the source inside of Firebug's console, even though it will contain some errors caused by Firebug. I'd also like to thank Forgotten Semicolon for explaining why "View Generated Source" doesn't match the actual source. If I could mark 2 best answers, I would.

    Read the article

  • Flex HDividedBox prevent dragging

    - by Jeremy Mitchell
    I'd love to be able to prevent dragging of a HDividedBox's divider based on a condition. for example: <mx:HDividedBox id="hd1" liveDragging="true" dividerDrag="dividerDragHandler(event)"> <Canvas id="c1"/> <Canvas id="c2"/> </HDividedBox> private function dividerDragHandler(event:DividerEvent):void { if (_something 10) { event.preventDefault(); } } Any ideas how I can do something like that? And I'd rather not mess with the widths of the child canvases. Thanks.

    Read the article

  • Session is Closed! NHibernate shouldn't be trying to grab data

    - by Jeremy Holovacs
    I have a UnitOfWork/Service pattern where I populate my model using NHibernate before sending it to the view. For some reason I still get the YSOD, and I don't understand why the object collection is not already populated. My controller method looks like this: public ActionResult PendingRegistrations() { var model = new PendingRegistrationsModel(); using (var u = GetUnitOfWork()) { model.Registrations = u.UserRegistrations.GetRegistrationsPendingAdminApproval(); } return View(model); } The service/unit of work looks like this: public partial class NHUserRegistrationRepository : IUserRegistrationRepository { public IEnumerable<UserRegistration> GetRegistrationsPendingAdminApproval() { var r = from UserRegistration ur in _Session.Query<UserRegistration>() where ur.Status == AccountRegistrationStatus.PendingAdminReview select ur; NHibernateUtil.Initialize(r); return r; } } What am I doing wrong?

    Read the article

  • Can this rectangle to rectangle intersection code still work?

    - by Jeremy Rudd
    I was looking for a fast performing code to test if 2 rectangles are intersecting. A search on the internet came up with this one-liner (WOOT!), but I don't understand how to write it in Javascript, it seems to be written in an ancient form of C++. Can this thing still work? Can you make it work? struct { LONG left; LONG top; LONG right; LONG bottom; } RECT; bool IntersectRect(const RECT * r1, const RECT * r2) { return ! ( r2->left > r1->right || r2->right left || r2->top > r1->bottom || r2->bottom top ); }

    Read the article

  • How do I test if a property exists on a object before reading its value?

    - by Jeremy Rudd
    I'm attempting to read a property on a series of Sprites. This property may or may not be present on these objects, and may not even be declared, worse than being null. My code is: if (child["readable"] == true){ // this Sprite is activated for reading } And so Flash shows me: Error #1069: Property selectable not found on flash.display.Sprite and there is no default value. Is there a way to test if a property exists before reading its value? Something like: if (child.isProperty("readable") && child["readable"] == true){ // this Sprite is activated for reading }

    Read the article

  • Float multiple fixed-width / varible-height boxes into 2 columns

    - by Jeremy H
    I'll try to explain this as best I can. I have multiple divs that are fixed-width but variable height. I want to float these boxes into two columns inside a fixed-width container. What happens when a give them all a float: left value, I get something like this: ######### ######### # box 1 # # box 2 # ######### # ..... # ......... # ..... # ......... ######### ######### ######### # box 3 # # box 4 # # ..... # # ..... # ######### ######### ######### ######### # box 5 # # box 6 # # ..... # ######### # ..... # ######### (The periods are white space) What I really would really like is the top of box 3 to touch the bottom of box 1. Any easy way to acheive this?

    Read the article

  • Java JMenuItem Accelator Snow Leopard

    - by Jeremy McGee
    about = new JMenuItem("About"); about.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A((Toolkit.getDefaultToolkit().getMenuShortcutMask())))); JMenu help = new JMenu("Help"); help.add(about); I was wondering why my aaccelerators were not working. I am running this in snow leopard with JavaSe-1.6 VM. They do work if I pull the menu down then try the key sequence. Thanks

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >