Search Results

Search found 838 results on 34 pages for 'sake'.

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

  • grails metaprogramming

    - by Don
    Hi, My understanding is that there are two obvious places in a Grails app where one can do meta-programming: The init closure of Bootstrap.groovy The doWithDynamicMethods closure of a plugin The meta-programming I'm referring to here should be visible throughout the metaprogramming, typical examples include adding (or replacing) methods of 3rd party classes. String.metaClass.myCustomMethod = { /* implementation omitted */ } The disadvantage of (1), is that the metaprogramming won't be applied when the application is dynamically reloaded. The disadvantage of (2) is that I need to create and maintain an entire plugin just for the sake of a little metaprogramming. Is there a better place to do this kind of metaprogramming? Thanks, Don

    Read the article

  • How to check if FORM Realm authentication failed?

    - by Sergio del Amo
    I use FORM Authentication. <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/loginPage.jsp</form-login-page> <form-error-page>/loginPage.jsp</form-error-page> </form-login-config> </login-config> I would like to use the same JSP for my form-login-page and form-error-page, for sake of code reuse. I use a Realm ( org.apache.catalina.realm.JDBCRealm ). In my JSP, I would like to display error messages if the authentication failed. Does Realm store anything in the request, which I could check?

    Read the article

  • iphone - passing an object on an UIToolbarButton action

    - by Mike
    Is that possible to make a UIToolbarButton pass an object to its target by using some exoteric method (as it seems not to be possible using regular button use)? I mean something like UIBarButtonItem *Button = [[UIBarButtonItem alloc] initWithImage:buttonImage style:UIBarButtonItemStylePlain target:self action:@selector(doSomething:) **withObject:usingThis**]; I know I can trigger a method that will launch the full method with the object, but for the sake of elegance I was trying to minimize the code... I suspect it is not possible, but as you guys out there are insanely good you may come with an transcendental answer... who knows...

    Read the article

  • How to paint background of specific range of text in NSTextView

    - by Rui Pacheco
    Hi, This is not a specific bug, its more about not knowing how to do something. I've an NSTextView and I need to paint the background of specific ranges of text when the user clicks on a specific part of the text view. I've tried this but I just get erratic behaviour in the sense that sometimes text loses the foreground color or the background doesn't span the whole range: NSLayoutManager *layoutManager = [myTextView layoutManager]; [layoutManager removeTemporaryAttribute:NSBackgroundColorAttributeName forCharacterRange:range]; [[myTextView layoutManager] setTemporaryAttributes:attributes forCharacterRange:range]; For the sake of simplicity assume that range is always a valid string (it is in my testing environment).

    Read the article

  • Creating an Improved Digital Zoom

    - by Kazar
    Hey, Ok, so I have a given video source (for the sake of the example, it is a camera). It does not have optical zoom, but we supply digital zoom instead. Now this digital zoom is pretty simple, simply cropping the image to a specified portion, and filling the screen with that portion. The problem is that the zoomed video can have pretty rubbish quality when the digital zoom is enabled. I am wondering if anyone knows of an approach by which a higher quality of digital zoom can be achieved in real-time. The software is on Windows, and the video is rendered using DirectShow, but it isn't a platform solution I'm necessarily after, more just a better approach to the problem. Cheers

    Read the article

  • MVC DateTime binding with incorrect date format

    - by Sam Wessel
    Asp.net-MVC now allows for implicit binding of DateTime objects. I have an action along the lines of public ActionResult DoSomething(DateTime startDate) { ... } This successfully converts a string from an ajax call into a DateTime. However, we use the date format dd/MM/yyyy; MVC is converting to MM/dd/yyyy. For example, submitting a call to the action with a string '09/02/2009' results in a DateTime of '02/09/2009 00:00:00', or September 2nd in our local settings. I don't want to roll my own model binder for the sake of a date format. But it seems needless to have to change the action to accept a string and then use DateTime.Parse if MVC is capable of doing this for me. Is there any way to alter the date format used in the default model binder for DateTime? Shouldn't the default model binder use your localisation settings anyway?

    Read the article

  • Add UIView behind UITableView in UITableViewController code

    - by Drew C
    I would like to use a fixed image as the background in a simple grouped table view in my iPhone program. Unfortunately, no matter what I do, the background is always solid white. I have followed several supposed solutions on this site and others to no avail. Here is the relavant code in the viewDidLoad method of the table view controller class (note, this code uses a solid blue color rather than an image for simplicity's sake): self.tableView.opaque = NO; self.tableView.backgroundColor = [UIColor clearColor]; UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; backgroundView.backgroundColor = [UIColor blueColor]; [self.tableView.window addSubview:backgroundView]; [backgroundView release]; I suspect that I am not positioning the backgroundView view in the right place. I have tried sendToBack:, bringToFront:, and others but I always just get a white background. Is it possible to do this from within the UITableViewController? Must I use Interface Builder?

    Read the article

  • Precompile Lambda Expression Tree conversions as constants?

    - by Nathan
    It is fairly common to take an Expression tree, and convert it to some other form, such as a string representation (for example this question and this question, and I suspect Linq2Sql does something similar). In many cases, perhaps even most cases, the Expression tree conversion will always be the same, i.e. if I have a function public string GenerateSomeSql(Expression<Func<TResult, TProperty>> expression) then any call with the same argument will always return the same result for example: GenerateSomeSql(x => x.Age) //suppose this will always return "select Age from Person" GenerateSomeSql(x => x.Ssn) //suppose this will always return "select Ssn from Person" So, in essence, the function call with a particular argument is really just a constant, except time is wasted at runtime re-computing it continuously. Assuming, for the sake of argument, that the conversion was sufficiently complex to cause a noticeable performance hit, is there any way to pre-compile the function call into an actual constant?

    Read the article

  • Twitter oauth_callback parameter being ignored!

    - by Astrofaes
    Hi guys, I'm trying to get Twitter authentication working on my ASP.NET site. When you create the app on the Twitter website, you have to specify a callback URL, which for sake of argument, I have set to http://mydomain.com I've read the oAuth 1.0a spec, and to override this callback URL with your own custom one you have to send the oauth_callback parameter in the request_token phase (url-encoded of course). So my request URL looks like this: http://twitter.com/oauth/request_token?oauth_callback_url=http%3A%2F%2Fmydomain.com%2Ftwittercallback Supposedly, if all goes to plan, in your response data, you are supposed to receive a new parameter of oauth_callback_confirmed=true in addition to your token and token secret parameters. However, my response comes through as: oauth_token=MYTOKEN&oauth_token_secret=MYTOKENSECRET I know I haven't given you guys the greatest amount to go on, but I'm at my wits end as to why I am not receiving the oauth_callback_confirmed parameter. Without this, my application keeps defaulting back to the callback URL hard-coded on the Twitter website. Please if anyone could help me out, I will be eternally grateful! Thanks, A.

    Read the article

  • Does MS Test provide a default value equals comparison?

    - by fearofawhackplanet
    I want to test for example int orderId = myRepository.SubmitOrder(orderA); orderB = myRepository.GetOrder(orderId); Assert.AreEqual(orderA, orderB); // fail Obviously I need a value comparison here, but I don't want to have to provide an overridden Equals implementation for all of my classes purely for the sake of testing (it wouldn't be of any use in the rest of the app). Is there a provided generic method that just checks every field using reflection? Or if not, it is possible to write my own?

    Read the article

  • Silverlight - Disabling Item Selection from ListBox

    - by Villager
    Hello, I have a ListBox defined in Silverlight. Each item in this ListBox has a CheckBox. Based on some rules when the ListBox is populated, some of the items in the ListBox get selected. This is used just for the sake of highlighting certain rows. When a user clicks an item in the ListBox, I want to check or uncheck the CheckBox in the item. However, I want to leave the item as appeared as selected because of the highlighting. Is there a way to do this? If not, is there a repeater control where I can highlight certain rows but not others when items are loaded? Thank you,

    Read the article

  • switch between two cursors based on parameter passed into stored procedure

    - by db83
    Hi, I have two cursors in my procedure that only differ on the table name that they join to. The cursor that is used is determined by a parameter passed into the procedure if (param = 'A') then DECLARE CURSOR myCursor IS SELECT x,y,z FROM table1 a, table2 b BEGIN FOR aRecord in myCursor LOOP proc2(aRecord.x, aRecord.y, aRecord.z); END LOOP; COMMIT; END; elsif (param = 'B') then DECLARE CURSOR myCursor IS SELECT x,y,z FROM table1 a, table3 b -- different table BEGIN FOR aRecord in myCursor LOOP proc2(aRecord.x, aRecord.y, aRecord.z); END LOOP; COMMIT; END; end if I don't want to repeat the code for the sake of one different table. Any suggestions on how to improve this? Thanks in advance

    Read the article

  • triying to do a combo select with this.val() but it doesnt show the second select

    - by irenkai
    Im triying to do a combo where the when the user selects Chile out of the select box, a second select shows up showing the cities. The jQuery code Im using is this. $(document).ready(function(){var ciudad = $("#ciudad"); ciudad.css("display","none"); $("select#selectionpais").change(function(){ var hearValue = $("select#selectionpais").val(); if( hearValue == "chile"){ ciudad.css("display","block"); ; }else{ ciudad.css("display","none") } }); }); and the Html is this (abreviated for the sake of understanding) <select name="pais" id="selectionpais"> .... Chile Afganistán and the second select (the one that should be shown is this) <select id="ciudad" name="ciudad" class="ciudad"> Santiago Anyone has a clue why it isnt working?

    Read the article

  • How to: WCF XML-RPC client?

    - by mr.b
    I have built my own little custom XML-RPC server, and since I'd like to keep things simple, on both server and client side, what I would like to accomplish is to create a simplest possible client (in C# preferably) using WCF. Let's say that Contract for service exposed via XML-RPC is as follows: [ServiceContract] public interface IContract { [OperationContract(Action="Ping")] string Ping(); // server returns back string "Pong" [OperationContract(Action="Echo")] string Echo(string message); // server echoes back whatever message is } So, there are two example methods, one without any arguments, and another with simple string argument, both returning strings (just for sake of example). Service is exposed via http. Aaand, what's next? :) P.S. I have tried googling around for samples and similar, but all that I could come up with are some blog-related samples that use existing (and very big/numerous) classes, which implement appropriate IContract (or IBlogger) interfaces, so that most of what I am interested is hidden below several layers of abstraction...

    Read the article

  • Visual Studio: Add necessary using directives with macro

    - by Kiril
    Hello guys, I am trying to do the following. Imagine you are reading some LINQ article and you decide to copy/paste some code from the article to a newly created project. In most cases, if you directly compile you will probably get an error for missing a using directives or assembly reference. I am trying to optimize the process where I have to go each keyword, click on it with the mouse and hit Shift + Alt + F10 to add the using directive. I know that it is not that much pain, but for the sake of optimization, is it possible and at what cost? Best Regards, Kiril

    Read the article

  • Storing And Using Microsoft User Account Credentials in MS SQL Srv 2008 Database

    - by instantmusic
    I'm not exactly positive how to word this for the sake of the title so please forgive me. Also I can't seem to figure out how to even google this question, so I'm hoping that I can get a lead in the right direction. Part of my software(VB.NET App) requires the ability to access/read/write a shared network folder. I have an option for the user to specify any credentials that might be needed to access said folder. I want to store these credentials given in the MS SQL Database as part of the config(I have a table which contains configuration). My concern is that the password for the user account will be unencrpyted. Yet, if I encrypt the password the VB.NET App And/Or database will be unable to use the credentials for file i/o operations unless the Password is unencrypted before use. I'm fishing for suggestions on how to better handle this situation.

    Read the article

  • Best way to remove an object from an array in Processing

    - by cmal
    I really wish Processing had push and pop methods for working with Arrays, but since it does not I'm left trying to figure out the best way to remove an object at a specific position in an array. I'm sure this is as basic as it gets for many people, but I could use some help with it, and I haven't been able to figure much out by browsing the Processing reference. I don't think it matters, but for your reference here is the code I used to add the objects initially: Flower[] flowers = new Flower[0]; for (int i=0; i < 20; i++) { Flower fl = new Flower(); flowers = (Flower[]) expand(flowers, flowers.length + 1); flowers[flowers.length - 1] = fl; } For the sake of this question, let's assume I want to remove an object from position 15. Thanks, guys.

    Read the article

  • Two models, one STI and a Validation

    - by keruilin
    Let's say I have two tables -- Products and Orders. For the sake of simplicity assume that only one product can be purchased at a time so there is no join table like order_items. So the relationship is that Product has many orders, and Order belongs to product. Therefore, product_id is a fk in the Order table. The product table is STI -- with the subclasses being A, B, C. When the user orders subclass Product C, two special validations must be checked on the Order model fields order_details and order_status. These two fields can be nil for all other Product subclasses (ie A and B). In other words, no validation needs to run for these two fields when a user purchases A and B. My question is: How do I write validations (perhaps custom?) in the Order model so that the Order model knows to only run the validations for the two fields -- order_details and order_status -- when Product subclass C is being saved to the orders table?

    Read the article

  • VBS Script for modifying multi-value Active Directory display specifier

    - by sh-beta
    Following the howto Extending the Active Directory Schema To Track Custom Info I'm able to setup a single-value schema attribute that is easily changeable via a context menu in ADUC. Multi-value schema attributes get considerably more complicated. Say (for the sake of argument) my value is "Projects" and each user may be a list as many projects as necessary. Following is a sad little script that will set Project to a single value: Dim oproject Dim oUser1 Dim temp1 Set oproject = Wscript.Arguments Set oUser1 = GetObject(oproject(0)) temp1 = InputBox("Project: " & oUser1.project & vbCRLF & vbCRLF & "Project") if temp1 <> "" then oUser1.Put "project",temp1 oUser1.SetInfo Set oUser1 = Nothing Set oproject = Nothing Set temp1 = Nothing WScript.Quit How can I modify this to allow, assign, and modify multiple values?

    Read the article

  • ViewController vs. View

    - by James
    Trying to wrap my head around the apple design scheme. I have a UIViewController and the corresponding XIB file that has my main screen in my application. I want to have a button on this XIB that displays another "form" (this is my disconnect) in the foreground where the user selects from a myriad of choices, then it hides that "form" and goes back to the first one. I'm completely lost here. Initially I thought I'd just add another view and set the self.view of my controller to the new view, add another IBAction and call it a day, but I can't seem to make that work. For sake of argument, say I want to "gray out" the current form, have a modal type window that takes up roughly 60% of the screen and requires you select an option, then it hides itself and we go back to normal. What is the standard approach here? Thanks

    Read the article

  • For programming content, what simple-to-use-and-setup PHP based blog are the preferred ones?

    - by Johann Gerell
    I've since long wanted a place I can toss my programming related nuggets at. Every day I feel I solve something that I'll surely hit again in a not so distant future, but by then I most certainly will have forgotten about the previous solution I came up with. So I need to blog it down, quick and dirty, for my own documentation and memory's sake. Must be easy to set up and use. Must handle code syntax and highlighting gracefully for a number of languages, but mainly C# and C++. Must be PHP-based, because that's what my host supplies. I know and have used WordPress (not for code, though), but is it really what I want or need?

    Read the article

  • tidy/efficient function writing in R

    - by romunov
    Excuse my ignorance, as I'm not a computer engineer but with roots in biology. I have become a great fan of pre-allocating objects (kudos to SO and R inferno by Patrick Burns) and would like to improve my coding habits. In lieu of this fact, I've been thinking about writing more efficient functions and have the following question. Is there any benefits in removing variables that will be overwritten at the start of the next loop, or is this just a waste of time? For the sake of argument, let's assume that the size of old and new variables is very similar or identical.

    Read the article

  • 2008 Datacenter Word Automation issue

    - by Brad
    We have an application that uses word automation. It works fine under Windows XP, but does not work on our Windows Server 2008 64-bit virtual machine running on VMware ESX unless it is running as the domain administrator. Under any other account (including a local admin), Word starts, uses a lot of CPU for 40 seconds when opening a document, and then just hangs. Our application does not access anything not on the local machine, and this machine is not being used for anything else (not a domain controller, etc). I know others have posted similar issues, with the solution of creating a Desktop folder somewhere under the windows directory. We did this, and it did not solve the problem (Word did not get as far as it did before we did this though). Please don't turn this into a thread about why I am trying to do this, whether I should do this, or whether I need to. For argument sake, I don't need to do this, but understanding what privilege a local admin does not have that is needed to do this is a legitimate concern.

    Read the article

  • SecurityException from Activator.CreateInstance(), How to grant permissons to Assembly?

    - by user365164
    I have been loading an assembly via Assembly.LoadFrom(@"path"); and then doing Type t = asm.GetType("Test.Test"); test = Activator.CreateInstance(t, new Object[] { ... }); and it was working fine, but now I moved the dll I am getting the following System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --- System.Security.SecurityException: Request for the permission of type 'System.Security.Permissons.SecurityPermission, etc .. For the sake of brevity it seems the demand was for an PermissionSet that allowed ControlAppDomain and it's not getting it. My question is how can I create this permissionset and pass it to the instance or assembly? I've been googling for hours to no avail.

    Read the article

  • SelfReferenceProperty vs. ListProperty Google App Engine

    - by John
    Hi All, I am experimenting with the Google App Engine and have a question. For the sake of simplicity, let's say my app is modeling a computer network (a fairly large corporate network with 10,000 nodes). I am trying to model my Node class as follows: class Node(db.Model): name = db.StringProperty() neighbors = db.SelfReferenceProperty() Let's suppose, for a minute, that I cannot use a ListProperty(). Based on my experiments to date, I can assign only a single entity to 'neighbors' - and I cannot use the "virtual" collection (node_set) to access the list of Node neighbors. So... my questions are: Does SelfReferenceProperty limit you to a single entity that you can reference? If I instead use a ListProperty, I believe I am limited to 5,000 keys, which I need to exceed. Thoughts? Thanks, John

    Read the article

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