Search Results

Search found 5718 results on 229 pages for 'apply'.

Page 8/229 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to apply query to model if field not filtered

    - by jdog
    I have a range of modules running on generator.yml. In some of those I would like to hide records by default of Status: CLOSED (being the last of a range of Statuses). OF course if the user filters for CLOSED i want to show these records. I thought it would make sense to apply andWhere('status_id=?',Status::CLOSED) in a specific table_method , but how do I access the filters of the module from within the model? Is there a better way to do this?

    Read the article

  • how to apply an animation into a triangle(Processing)

    - by dc_ou
    I want to create a simple animation, that can only show in a specific area, such as triange. I already have the animation, a rotating picture. but I dont know how to put it into the triangle. the function texture() can only apply images into a specific area. is there other ways to do that? thx!

    Read the article

  • How to apply a filter to the screen of a running program?

    - by Shahbaz
    The idea is to take old games without modifying them, but have the graphics card apply a series of filters to their output before sending them to the monitor. A very crude example would be to take a game that has a resolution of 640x480 and do: Increase the resolution to 1280x960 Apply a blur (low pass filter) Apply a sharpen (1 + high pass filter) These steps may not necessarily be the best to improve the visuals of an old game, but there are a lot of techniques that are well-known in image processing for this purpose. The question is, do the (NVidia) graphics cards give the ability to load a program that modifies the screen before sending it to the monitor? If so, how are they called and what terminology should I use to search? I would be comfortable with doing the programming myself if this ability is part of a library. Also, would the solution be different between Windows and Linux? If so, either is fine, since most of the games are probably runnable by wine.

    Read the article

  • Apply Button() to an element inside a variable

    - by Ben
    If have a variable data = '<div>... <button id="remember"> ... </button> ...</div>', is it possible to apply the .button(); method to a button inside that variable? I've tried the following: $('#remember', data).button(); but that doesn't work. After that i just do $(data).dialog();, which works. I've come with a workaround and that's to append the variable data to the document, call the .button() and then call the .dialog(), but appending and removing dialog's divs on the document doesn't seems right.

    Read the article

  • JavaScript Same Origin Policy - How does it apply to different subdomains

    - by DaveDev
    How does the Same Origin Policy apply to the following two domains? http://server1.MyDomain.com http://server2.MyDomain.com Can I run JS on a page hosted on server1, if the content is retreived from server2? edit according to Daniel's answer below, I can include scripts between different subdomains using the <script> tag, but what about asynchronous requests? What if I download a script from server2 onto the page hosted on server1. Can I use the script to communicate asynchronously with a service on server2?

    Read the article

  • How to apply the shake effect to a dialog with an embedded form

    - by Felix Guerrero
    Hi. I'm newbie on this, I'm trying to apply the shake effect to a dialog that has an embedded form but not success on this. When I try to trigger the effect $("#divDialogContainer").effect("shake", {times: 3}, 80); only the fields inside the form tag is taking the effect but the dialog box itself doesn't. My div Code My dialog $("#restore_password").dialog({ height: 220, width: 310, autoOpen: false, modal: true, draggable: false, resizable: false, show: 'puff', hiden: 'puff', buttons: { "Confirm": function(){ $("#change_password").dialog('open'); }, "Cancel": function(){ $(this).dialog('close'); $("#forgot_data").dialog('close'); $("#dialog-form").dialog('open'); setTimeout(function(){ $("#name").focus(); }, 800); } }, close: function() { allFields.val('').removeClass('ui-state-error'); } }); Any ideas?, it would be helpful.

    Read the article

  • How to apply a patch

    - by Niroshan
    I have this patch code which i downloaded from a web article (Calling Matlab from Java). http://www.cs.virginia.edu/~whitehouse/matlab/JavaMatlab.html But I donot know how to apply it in my windowsXp running computer. What I'm trying to do is call Matlab script file from java. I have found the necessary source codes and every thing but this mater is holding be back. Any help is highly appreciated. Thank you. Here's the patch code. Index: MatlabControl.java =================================================================== RCS file: /cvsroot/tinyos/tinyos-1.x/tools/java/net/tinyos/matlab/MatlabControl.java,v retrieving revision 1.3 diff -u -r1.3 MatlabControl.java --- MatlabControl.java 31 Mar 2004 18:43:50 -0000 1.3 +++ MatlabControl.java 16 Aug 2004 20:36:51 -0000 @@ -214,7 +214,8 @@ matlab.evalConsoleOutput(command); }else{ - matlab.fevalConsoleOutput(command, args, 0, null); + // matlab.fevalConsoleOutput(command, args, 0, null); + matlab.fevalConsoleOutput(command, args); } } catch (Exception e) { System.out.println(e.toString());

    Read the article

  • How apply a storyboard to a Label programmatically ?

    - by ThitoO
    Hi :), I've a little problem, I'd search google and my Wpf's books but I don't found any answer :( I have created a little storyboard : <Storyboard x:Key="whiteAnim" Duration="1"> <ColorAnimation By="Black" To="White" Storyboard.TargetProperty="Background" x:Name="step1"/> <ColorAnimation By="White" To="Black" Storyboard.TargetProperty="Background" x:Name="step2"/> </Storyboard> This animation will change background color from black to white, and from white to black. I want to "apply" this storyboard to a Label : Label label = new Label(); label.Content = "My label"; I'm looking for a method like "label.StartStoryboard(--myStoryboard--), do you have any ideas ? Thank you :)

    Read the article

  • WPF: Bind/Apply Filter on Boolean Property

    - by Julian Lettner
    I want to apply a filter to a ListBox accordingly to the IsSelected property of a CheckBox. At the moment I have something like this. XAML <CheckBox Name="_filterCheckBox" Content="Filter list" Checked="ApplyFilterHandler"/> <ListBox ItemsSource="{Binding SomeItems}" /> CodeBehind public ObservableCollection<string> SomeItems { get; private set; } private void ApplyFilterHandler(object sender, RoutedEventArgs e) { if (_filterCheckBox.IsChecked.Value) CollectionViewSource.GetDefaultView(SomeItems).Filter += MyFilter; else CollectionViewSource.GetDefaultView(SomeItems).Filter -= MyFilter; } private bool MyFilter(object obj) { return ... } It works but this solution feels like the old-fashioned way (Windows Forms). Question: Is it possible to achieve this with Bindings / in XAML? Thanks for your time.

    Read the article

  • How apply Unit tests in ASP.NET webforms

    - by gre3ns0ul
    Hi guys. I'm developing a website in asp.net webforms with 3 layers; UI, BLL and DAL The website is already developed, but i like have more control about the unit tests of each form Pass specific values at specific inputs for i see, if application survives or not. I already study about NUnit but in webforms in UI layer how can apply these tests? What i wnat is get some way to test UI (validations) without have to access to the BLL as i was an user. I'm trying to add the Unit tests to my app but i not sure how to do it! somebody can help my small-bigger problem? apreciated

    Read the article

  • VB.net Edit-And-Continue: ignore "unable to apply this change while debugging"

    - by FastAl
    When using VB.Net (2008) and paused in debugging, Edit-And-Continue is a great time-saver. However if you change any module/class-level information (variable, sub/function signature, etc), you get the error message like this: "unable to apply this change while debugging" While I can understand the technical challenge to making this work (and why it would be hard), it leaves me in a tight spot with just a few options: 1) Restart and recompile and get the program back to the same state 2) Continue debugging without making the change, and risk forgetting 3) Type up a reminder note to make the change All of which are annoying. Now I know that option '4) Just actually make the change' may not be possible. but does anybody know how to enable the following 'technically easy' possibility? 4) Let me change the code, get it flagged with the purple squiggly underline, so I can save it, but just ignore the change until recompile I have checked the Tools|options|debug|edit and continue, nothing appears to let me do this. thanks!

    Read the article

  • Apply Alloy UI 1.5 datepicker to multiple instances

    - by MyTitle
    I want to create Alloy UI datapickers on multiple form fields: <div id="date_1_wrapper"> <input type="text" class="datepick" id="date_1" /> </div> <div id="date_2_wrapper"> <input type="text" class="datepick" id="date_2" /> </div> Using JQuery I can do it using following code: $('.datepick').each(function(){ $(this).datepicker(); }); But how to achieve same functionality in Alloy UI? For now I use following code, but this code apply DatePickers by ID, not by CSS class in loop: AUI().use( 'aui-datepicker', function(A) { new A.DatePicker ( { calendar: { dateFormat: '%d/%m/%Y' }, trigger: '#date_1' } ).render('#date_1_wrapper'); new A.DatePicker( { calendar: { dateFormat: '%d/%m/% }, trigger: '#date_2' } ).render('#date_2_wrapper'); } ); I think it this code can be used in beginning, but how to deal with input's and div's ID's? (A.all('.datepcik').each(function() {)

    Read the article

  • How to apply encoding when reading from a serial port

    - by rross
    I'm reading data from a serial port. I read this posting: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/a709d698-5099-4e37-9e10-f66ff22cdd1e He is writing about many of the issues I have encounter, but in his writing he refers to using: System.Text.Encoding.GetEncoding("Windows-1252"). The problem I'm having is when and how to apply this. There are three potitional spots in my opinion. When the serial port object is define: private SerialPort comport = new SerialPort(); The Event handler: comport.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived); Or when reading the data: string data = comport.ReadExisting(); No matter where I add it. I seem to get errors. How would one use Encoding?

    Read the article

  • How to apply patterns when not all team members can follow them

    - by michael moore
    We're going to start a new huge project and while it's in the process of architecting the system, I have certain doubts whether I can apply patterns and be sure they won't be violated by team members. The problem is, not all team members have enough skills to develop asp.net apps let's say using MVP pattern. So maybe this question is addressed to Team leads, or experienced devs. Did you dealt with this kind of situation, and if so what was your solution. I was thinking to create the core by myself, and let 'em start building upon that core, however I'm not sure it will work out.

    Read the article

  • Patching this Code to apply dynamic (iPhone) background position

    - by Brian
    I posted a question previously that got off topic, I'm reposting with better code that I have VERIFIED is compatible with iPhone (it works with mine anyway!) I just want to apply background-position coordinates to the body element and call the script conditionally for iPhone, iPod, & iPad. Here's my conditional call for those devices: var deviceAgent = navigator.userAgent.toLowerCase(); var agentID = deviceAgent.match(/(iphone|ipod|ipad)/); if (agentID) { // do something } else { //do this } Now, I've found this excellent script that sets the "top: x" dynamically on the basis of scroll position. Everyone has told me (and ALL of the tutorials and Google search results as well) that it's impossible to set scroll position dynamically for iPhone because of the viewport issue. HOWEVER, they are wrong because if you scroll to the bottom of the page and view this javascript demo on iPhone, you can scroll and the <div style="background-position: fixed; top: x (variable)"></div> div DOES stay centered on iPhone. I really hope this question helps alot of people, I thought it was impossible, but it's NOT... I just need help stitching it together! The original code (you can test it on iPhone yourself) is here: http://stevenbenner.com/2010/04/calculate-page-size-and-view-port-position-in-javascript/ So I just need help getting the following code to apply the dynamic "background-position: 0 x" to the BODY tag where x is centered and relative to the viewport position. Also, needs to be nested inside the above code that is conditional for iPhone and similar devices. // Page Size and View Port Dimension Tools // http://stevenbenner.com/2010/04/calculate-page-size-and-view-port-position-in-javascript/ if (!sb_windowTools) { var sb_windowTools = new Object(); }; sb_windowTools = { scrollBarPadding: 17, // padding to assume for scroll bars // EXAMPLE METHODS // center an element in the viewport centerElementOnScreen: function(element) { var pageDimensions = this.updateDimensions(); element.style.top = ((this.pageDimensions.verticalOffset() + this.pageDimensions.windowHeight() / 2) - (this.scrollBarPadding + element.offsetHeight / 2)) + 'px'; element.style.left = ((this.pageDimensions.windowWidth() / 2) - (this.scrollBarPadding + element.offsetWidth / 2)) + 'px'; element.style.position = 'absolute'; }, // INFORMATION GETTERS // load the page size, view port position and vertical scroll offset updateDimensions: function() { this.updatePageSize(); this.updateWindowSize(); this.updateScrollOffset(); }, // load page size information updatePageSize: function() { // document dimensions var viewportWidth, viewportHeight; if (window.innerHeight && window.scrollMaxY) { viewportWidth = document.body.scrollWidth; viewportHeight = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but explorer mac viewportWidth = document.body.scrollWidth; viewportHeight = document.body.scrollHeight; } else { // explorer mac...would also work in explorer 6 strict, mozilla and safari viewportWidth = document.body.offsetWidth; viewportHeight = document.body.offsetHeight; }; this.pageSize = { viewportWidth: viewportWidth, viewportHeight: viewportHeight }; }, // load window size information updateWindowSize: function() { // view port dimensions var windowWidth, windowHeight; if (self.innerHeight) { // all except explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // explorer 6 strict mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; }; this.windowSize = { windowWidth: windowWidth, windowHeight: windowHeight }; }, // load scroll offset information updateScrollOffset: function() { // viewport vertical scroll offset var horizontalOffset, verticalOffset; if (self.pageYOffset) { horizontalOffset = self.pageXOffset; verticalOffset = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict horizontalOffset = document.documentElement.scrollLeft; verticalOffset = document.documentElement.scrollTop; } else if (document.body) { // all other Explorers horizontalOffset = document.body.scrollLeft; verticalOffset = document.body.scrollTop; }; this.scrollOffset = { horizontalOffset: horizontalOffset, verticalOffset: verticalOffset }; }, // INFORMATION CONTAINERS // raw data containers pageSize: {}, windowSize: {}, scrollOffset: {}, // combined dimensions object with bounding logic pageDimensions: { pageWidth: function() { return sb_windowTools.pageSize.viewportWidth > sb_windowTools.windowSize.windowWidth ? sb_windowTools.pageSize.viewportWidth : sb_windowTools.windowSize.windowWidth; }, pageHeight: function() { return sb_windowTools.pageSize.viewportHeight > sb_windowTools.windowSize.windowHeight ? sb_windowTools.pageSize.viewportHeight : sb_windowTools.windowSize.windowHeight; }, windowWidth: function() { return sb_windowTools.windowSize.windowWidth; }, windowHeight: function() { return sb_windowTools.windowSize.windowHeight; }, horizontalOffset: function() { return sb_windowTools.scrollOffset.horizontalOffset; }, verticalOffset: function() { return sb_windowTools.scrollOffset.verticalOffset; } } };

    Read the article

  • Apply function to one element of a list in Python

    - by user189637
    I'm looking for a concise and functional style way to apply a function to one element of a tuple and return the new tuple, in Python. For example, for the following input: inp = ("hello", "my", "friend") I would like to be able to get the following output: out = ("hello", "MY", "friend") I came up with two solutions which I'm not satisfied with. One uses a higher-order function. def apply_at(arr, func, i): return arr[0:i] + [func(arr[i])] + arr[i+1:] apply_at(inp, lambda x: x.upper(), 1) One uses list comprehensions (this one assumes the length of the tuple is known). [(a,b.upper(),c) for a,b,c in [inp]][0] Is there a better way? Thanks!

    Read the article

  • Javascript: Access the right scope "under" apply(...)

    - by Chau
    This is a very old problem, but I cannot seem to get my head around the other solutions presented here. I have an object function ObjA() { var a = 1; this.methodA = function() { alert(a); } } which is instantiated like var myObjA = new ObjA(); Later on, I assign my methodA as a handler function in an external Javascript Framework, which invokes it using the apply(...) method. When the external framework executes my methodA, this belongs to the framework function invoking my method. Since I cannot change how my method is called, how do I regain access to the private variable a? My research tells me, that closures might be what I'm looking for.

    Read the article

  • How to apply multiple filters to sharepoint list

    - by Juraj Hajek
    Hi all, I have sharepoint list with several columns - month, year and some custom data. I want to provide 2 dropdowns to allow user select month and year to filter rows. I added "Choice Filter" webpart for month and set connection to list (this works). I added second "Choice Filter" for year and I wanted to do the same. However, I cannot set connection to list, because mylist is disabled in webpart menu "Edit-Connections-Send filter values to". How can I apply 2 filtering criteria? Thanks, Juraj

    Read the article

  • apply CSS style to particular elements dynamically

    - by WHITECOLOR
    I have a div with paragraphs inside: <div> <p>...</p> <p>...</p> </div> I want dynamically to apply a certain style to paragraphs inside this div. Is it possible to do that without handling each paragraph element, but just attach somehow style to div element and all inside paragraphs would be affected? Maybe with jquery. It sounds for me like dynamical change of the stylesheet, is it possbile? Thanks.

    Read the article

  • Apply CSS class to invalid controls on web form

    - by user137639
    I need to apply a css class to invalid controls on a web form. I'd like to make it a resusable class. This is what I have so far: public class Validation { public static void ApplyInvalidClass(Page page, string className) { foreach (System.Web.UI.WebControls.BaseValidator bv in page.Validators) { if (!bv.IsValid) { Control ctrl = page.FindControl(bv.ControlToValidate); if (ctrl != null) { if (ctrl is TextBox) { TextBox txt = ctrl as TextBox; txt.CssClass = "invalid"; } if (ctrl is DropDownList) { DropDownList ddl = ctrl as DropDownList; ddl.CssClass = "invalid"; } if (ctrl is CheckBox) { CheckBox cb = ctrl as CheckBox; cb.CssClass = "invalid"; } if (ctrl is HtmlGenericControl) { HtmlGenericControl html = ctrl as HtmlGenericControl; html.Attributes.Add("class", className); } } } } } } The problem is what I call this on a .Net user control, I guess because I'm passing in Page, page.FindControl(bv.ControlToValidate) is always null. Is there a better way to do this?

    Read the article

  • How to apply a update after an inser or update POSTGRESQL Trigger

    - by user3718906
    How to apply an update after an insert or update in POSTGRESQL; I have got a table which has a field lastupdate; I want that field to be set up whenever the row is updated or when it was inserted. I tried this trigger, but It is not working! HELP!! CREATE OR REPLACE FUNCTION fn_update_profile() RETURNS TRIGGER AS $update_profile$ BEGIN IF (TG_OP = 'INSERT' OR TG_OP = 'UPDATE' ) THEN UPDATE profile SET lastupdate=now() where oid=OLD.oid; RETURN NULL; ELSEIF (TG_OP = 'DELETE') THEN RETURN NULL; END IF; RETURN NULL; -- result is ignored since this is an AFTER trigger END; $update_profile$ LANGUAGE plpgsql;

    Read the article

  • apply function using expand.grid in R

    - by kolonel
    I have two vectors x and y. I create a grid using the following function: v = expand.grid(x, y) I have a function defined as follows N <- function(a, b , dat){ m = ncol(Filter(function(z) a*max(z)*min(z) < b , dat[1:ncol(dat)])) return(m) } and then I need to maximize N over a grid of x,y: Maximize <- function(x , y ,dat){ v = as.matrix(expand.grid(x,y)) # Here is where I want to map the values of v and get the maximum element and # get the tuple in v that maximized N temp1 <- max(apply(v , 1 , N(v[[1]] , v[[2]] , dat))) } Thanks

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >