Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 157/433 | < Previous Page | 153 154 155 156 157 158 159 160 161 162 163 164  | Next Page >

  • Customized generation/filtering resources with maven

    - by zamza
    I wonder what is the Maven way in my situation. My application has a bunch of configuration files, let's call them profiles. Each profile configuration file is a *.properties file, that contains keys/values and some comments on these keys/values semantics. The idea is to generate these *.properties to have unified comments in all of them. My plan is to create a template.properties file that contains something like #Comments for key1/value1 key1=${key1.value} #Comments for key2/value2 key2=${key2.value} and a bunch of files like #profile_data_1.properties key1.value=profile_1_key_1_value key2.value=profile_1_key_2_value #profile_data_2.properties key1.value=profile_2_key_1_value key2.value=profile_2_key_2_value Then bind to generate-resources phase to create a copy of template.properties per profile_data_*, and filter that copy with profile_data_*.properties as a filter. The easiest way is probably to create an ant build file and use antrun plugin. But that is not a Maven way, is it? Other option is to create a Maven plugin for that tiny task. Somehow, I don't like that idea (plugin deployment is not what I want very much).

    Read the article

  • jQuery: How to remove this code redundancy?

    - by Mark
    clone.find('[id]').each(function() { id = $(this).attr('id'); ind = id.search(/\d+$/); $(this).attr('id', id.substr(0,ind)+id_counter); }); clone.find('[for]').each(function() { id = $(this).attr('for'); ind = id.search(/\d+$/); $(this).attr('for', id.substr(0,ind)+id_counter); }); I know I can find elements that have either the id attribute or the for attribute, but then how do I know which one I need to set?

    Read the article

  • How to detect tab key pressing in C#?

    - by user342325
    I want to detect when tab key is pressed in a textBox and focus the next textbox in the panel. I have tried out keyPressed method and keyDown method. But when I run the program and debug those methods are not calling when the tab key is pressed. Here is my code. private void textBoxName_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Tab) { textBoxUsername.Focus(); } } private void textBoxName_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar==(char)Keys.Tab) { textBoxUsername.Focus(); } } Please correct me.Thank you.

    Read the article

  • Jquery tooltip plugin qTip doesn't seem to set width properly

    - by ooo
    i have an asp.net mvc site and here is a dynamic tooltip using qTip Here is my code: $('a.showNutritionInfo').each(function() { $(this).qtip({ content: { text: '<img src="../../images/ajax-loader1.gif" alt="" />', style: { width: 450 }, url: '/Tracker/NutritionInfo/' + $(this).attr('id'), method: 'get' } }); }); this works perfectly EXCEPT the width attribute listed above is ignored. No matter what i put in that width attribute, i get the same size width tooltip which is about half of the width that i need. the height is perfectly fine. any ideas? is this a bug in the product ?

    Read the article

  • Getting list of fields back from 'use fields' pragma?

    - by makenai
    So I'm familiar with the use fields pragma in Perl that can be used to restrict the fields that are stored in a class: package Fruit; use fields qw( color shape taste ); sub new { my ( $class, $params ) = @_; my $self = fields::new( $class ) unless ref $class; foreach my $name ( keys %$params ) { $self->{ $name } = $params->{ $name }; } return $self; } My question is.. once I've declared the fields at the top, how I can get the list back.. say because I want to generate accessors dynamically? Is keys %FIELDS the only way? Secondarily, is there a more efficient way to pre-populate the fields in the constructor than looping through and assigning each parameter as I am above? Thanks!

    Read the article

  • How do I bind a key to "the function represented by the following key sequence"?

    - by katrielalex
    I'm just starting to learn emacs (woohoo!) and I've been mucking around in my .emacs quite happily. Unfortunately, I don't know Lisp yet, so I'm having issues with the basics. I've already remapped a few keys until I fix my muscle memory: (global-set-key (kbd "<f9>") 'recompile) That's fine. But how can I tell a key to 'simulate pressing several keys'? For instance, I don't know, make <f1> do the same as C-u 2 C-x } (widen buffer by two chars). One way is to look up that C-x } calls shrink-window-horizontally, and do some sort of lambda thing. This is of course the neat and elegant way (how do you do this?). But surely there's a way to define <f1> to send the keystrokes C-u 2 C-x }?

    Read the article

  • Grails - Need to restrict fetched rows based on condition on join table

    - by sector7
    Hi guys, I have these two domains Car and Driver which have many-to-many relationship. This association is defined in table tblCarsDrivers which has, not surprisingly, primary keys of both the tables BUT additionally also has a new boolean field deleted. Herein lies the problem. When I find/get query on domain Car, I am fetched all related drivers irrespective of their deleted status in tblCarsDrivers, which is expected. I need to put a clause/constraint to exclude the deleted drivers from the list of fetched records. PS: I tried using an association domain CarDriver in joinTable name but that seems not to work. Apparently it expects only table names, not maps. PPS: I know its unnatural to have any other fields besides the mapping keys in mapping table but this is how I got it and it cant be changed. Car domain is defined as such - class Car { Integer id String name static hasMany = [drivers:Driver] static mapping = { table 'tblCars' version false drivers joinTable:[name: 'tblCarsDrivers',column:'driverid',key:'carid'] } } Thanks!

    Read the article

  • How can i use listDictionary?

    - by Phsika
    i can fill my listdictinary but, if running error returns to me in " foreach (string ky in ld.Keys)"(invalid operation Exception was unhandled) Error Detail : After creating a pointer to the list of sample collection has been changed. C# ListDictionary ld = new ListDictionary(); foreach (DataColumn dc in dTable.Columns) { MessageBox.Show(dTable.Rows[0][dc].ToString()); ld.Add(dc.ColumnName, dTable.Rows[0][dc].ToString()); } foreach (string ky in ld.Keys) if (int.TryParse(ld[ky].ToString(), out QuantityInt)) ld[ky] = "integer"; else if(double.TryParse(ld[ky].ToString(), out QuantityDouble)) ld[ky]="double"; else ld[ky]="nvarchar";

    Read the article

  • ASP.net MVC Using view models in different views

    - by Azhar Rana
    i have 2 customer views one for create and one for edit. i am using the same Customer view model for both. i want to make the 'customer no field' required on the add but not the edit. if i put the requiredfield attribute on the view model property then both views flag 'Customer No' as required (as you would expect). Is there a built in solution to get around this problem or am i going to have to create 2 seperate view models, one with the attribute and one without. Thanks

    Read the article

  • Can C# make my class look like another class?

    - by Vaccano
    I have a class that look like this: public class BasePadWI { public WorkItem WorkItemReference { get; set; } .... Other stuff ...... } I then have a dictionary that is defined like this: public Dictionary<BasePadWI, Canvas> Pad { get; set; } I would then like to make a call like this: List<WorkItem> workItems = Pad.Keys.ToList(); (Note: WorkItem is a sealed class, so I cannot inherit.) Is there some trickery that I could do in the class to make it look like a WorkItem? I have done this in the mean time: List<WorkItem> workItems = Pad.Keys.ToList().ConvertAll(x=>x.WorkItem);

    Read the article

  • Constructing a regular expression to wrap images with <a>

    - by bobo
    A web page contains lots of image elements: <img src="myImage.gif" width="180" height="18" /> But they may not be very well-formed, for example, the width or height attribute may be missing. And it also may not be properly closed with /. The src attribute is always there. I need a regular expression that wraps these with a hyperlink having href set to the src of the img. <a href="myImage.gif" target="_blank"><img src="myImage.gif" width="180" height="18" /></a> I can successfully locate the images using this regexp in this editor: http://gskinner.com/RegExr/: <img src="([^<]*)"[^<]*> But what is the next step?

    Read the article

  • What is __path__ useful for?

    - by Jason Baker
    I had never noticed the __path__ attribute that gets defined on some of my packages before today. According to the documentation: Packages support one more special attribute, __path__. This is initialized to be a list containing the name of the directory holding the package’s __init__.py before the code in that file is executed. This variable can be modified; doing so affects future searches for modules and subpackages contained in the package. While this feature is not often needed, it can be used to extend the set of modules found in a package. Could somebody explain to me what exactly this means and why I would ever want to use it?

    Read the article

  • AutoComplete field and IE

    - by user102533
    My web page does not have the autocomplete attribute that would tell browsers not to autocomplete the field. In spite of not having this attribute, IE 8 or Safari (not sure on other browsers) does not autocomplete the page. Autocomplete does work on some sites (such as Gmail) so I am assuming that the browser setting is not causing it? Here's the code: <tr> <td>User Id</td> <td><input name="userId" type="text" id="userId" runat="server" /></td> </tr> <tr> <td>Password</td> <td><input name="password" type="password" id="password" enableviewstate="false" runat="server" /></td> </tr>

    Read the article

  • How to unregister a specific hotkey using c#

    - by srk
    I am using the below code to register a HotKey : RegisterGlobalHotKey(Keys.F4, USE_ALT); private void RegisterGlobalHotKey(Keys hotkey, int modifiers) { try { // increment the hot key value - we are just identifying // them with a sequential number since we have multiples mHotKeyId++; if (mHotKeyId > 0) { // register the hot key combination if (RegisterHotKey(this.Handle, mHotKeyId, modifiers, Convert.ToInt16(hotkey)) == 0) { // tell the user which combination failed to register - // this is useful to you, not an end user; the end user // should never see this application run MessageBox.Show("Error: " + mHotKeyId.ToString() + " - " + Marshal.GetLastWin32Error().ToString(), "Hot Key Registration"); } } } catch { // clean up if hotkey registration failed - // nothing works if it fails UnregisterGlobalHotKey(); } } private void UnregisterGlobalHotKey() { // loop through each hotkey id and // disable it for (int i = 0; i < mHotKeyId; i++) { UnregisterHotKey(this.Handle, i); } } How can i unregister the Hot key and Make Alt+ F4 keep working again ?

    Read the article

  • Using code from this site

    - by user553798
    Hi, The legal section of this site mentions that all code by the contributors is licensed under the Creative Commons Attribution Share Alike License. Does this mean that I have to attribute the submitter even if the code in question is a few lines amongst hundreds or thousands of lines of code? What if I use code from a book or SDK? For eg; If I use the sample code from Google's Android SDK documentation, does that mean I need to attribute Google every time I write an app, after all it would be impossible to write an app without consulting the SDK docs, atleast initially... I am totally confused :S

    Read the article

  • How to Create an Array from a Single Variable and Form Multiple Foreach Loops?

    - by matphoto
    I'm fairly proficient in HTML/CSS, but very new when it comes to the likes of PHP and Javascript. I've jumped headfirst into coding Wordpress shortcodes (basically php functions), and so far, through trial and error and seemingly endless browser refreshes, I've been able to figure everything out. I just hit a huge wall though, hence why I'm here. Basically, I'm trying to give an attribute a list of values like: attr="23, 95, 136, ect" The function then needs to take that attribute variable and create an array with it: $arr = array($attr); To me that seems as if it would work, but the array takes the whole list as one value instead. After doing that I want to create a foreach loop that parses each number from the list, possibly through yet another foreach loop if possible, and returns a section of code for each one, and I'm not quite sure how to pull that off either. Any feedback would be greatly appreciated.

    Read the article

  • Runtime Error in asp.net site?

    - by Surya sasidhar
    hi, I developed a website in asp.net and i place the site in online. I upload my site in online by using CuteFTP. After uploading when i type my url it is giving error like this... Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off". Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.

    Read the article

  • Phonegap 2.1 for Android - Hello World App 3 errors at launch

    - by noway
    I developed something with Phonegap for iOS, but this is my first trial for Android. I created my hello world application with CLI sth like this mentioned here: $ /path/to/cordova-android/bin/create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName Even though I created this app in Eclipse Workspace, I needed to import it to Eclipse. I created two AVDs. One for API level 8, one for API level 16. When I try to build, it gives me these three errors and a warning. What is wrong with my setup? Description Resource Path Location Type error: No resource identifier found for attribute 'hardwareAccelerated' in package 'android' AndroidManifest.xml /com.example.test.testprojectname line 20 Android AAPT Problem error: No resource identifier found for attribute 'xlargeScreens' in package 'android' AndroidManifest.xml /com.example.test.testprojectname line 22 Android AAPT Problem error: Error: String types not allowed (at 'configChanges' with value 'orientation|keyboardHidden|keyboard|screenSize|locale'). AndroidManifest.xml /com.example.test.testprojectname line 51 Android AAPT Problem The import android.app.Activity is never used testprojectname.java /com.example.test.testprojectname/src/com/example/test line 22 Java Problem

    Read the article

  • Couldn't I just pass an copied string to an Core Data property?

    - by dontWatchMyProfile
    The docs say: The default implementation does not copy attribute values. If the attribute value may be mutable and implements the NSCopying protocol (as is the case with NSString, for example), you can copy the value in a custom accessor to help preserve encapsulation (for example, in the case where an instance of NSMutableString is passed as a value). So instead of getting into trouble and inconvenience with overwriting accessors in my NSManagedObject subclass, couldn't I simply do something like this? myManagedObject.firstName = [[firstNameMutableStr copy] autorelease]; This would have the exact same effect, or not? The dynamic implementation would retain that anyways ... so.... why not the easy way?

    Read the article

  • Is it possible to make JQuery keydown respond faster?

    - by Drew Paul
    I am writing a simple page with JQuery and HTML5 canvas tags where I move a shape on the canvas by pressing 'w' for up, 's' for down, 'a' for left, and 'd' for right. I have it all working, but I would like the shape to start moving at a constant speed upon striking a key. Right now there is some kind of hold period and then the movement starts. How can I get the movement to occur immediately? Here the important part of my code: Your browser does not support the HTML5 canvas tag. start navigating coords should pop up here key should pop up here var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); //keypress movements var xtriggered = 0; var keys = {}; var north = -10; var east = 10; var flipednorth = 0; $(document).ready(function(e){ $("input").keydown(function(){ keys[event.which] = true; if (event.which == 13) { event.preventDefault(); } //press w for north if (event.which == 87) { north++; flipednorth--; } //press s for south if (event.which == 83) { north--; flipednorth++; } //press d for east if (event.which == 68) { east++; } //press a for west if (event.which == 65) { east--; } var msg = 'x: ' + flipednorth*5 + ' y: ' + east*5; ctx.beginPath(); ctx.arc(east*6,flipednorth*6,40,0,2*Math.PI); ctx.stroke(); $('#soul2').html(msg); $('#soul3').html(event.which ); $("input").css("background-color","#FFFFCC"); }); $("input").keyup(function(){ delete keys[event.which]; $("input").css("background-color","#D6D6FF"); }); }); </script> please let me know if I shouldn't be posting code this lengthy.

    Read the article

  • What does :this means in Ruby on Rails?

    - by Marco
    Hi, I'm new to the Ruby and Ruby on Rails world. I've read some guides, but i've some trouble with the following syntax. I think that the usage of :condition syntax is used in Ruby to define a class attribute with some kind of accessor, like: class Sample attr_accessor :condition end that implicitly declares the getter and setter for the "condition" property. While i was looking at some Rails sample code, i found the following examples that i don't fully understand. For example: @post = Post.find(params[:id]) Why it's accessing the id attribute with this syntax, instead of: @post = Post.find(params[id]) Or, for example: @posts = Post.find(:all) Is :all a constant here? If not, what does this code really means? If yes, why the following is not used: @posts = Post.find(ALL) Thanks

    Read the article

  • Regex for xml parsing

    - by ogmios
    What is your opinon about following regexes - is it correct? To find element with spcific and required attribute "<(" + elem_name + ")(\s+(?:[^<]?\s+)" + attr_name + "\s*=\s*(['\"])((?:(?!\3).))\3[^<])(.*?)" To find element with spcific but optional attribute "<(" + elem_name + ")(\s*|\s+(?:[^<]?\s+)(?:" + attr_name + "\s*=\s*(['\"])((?:(?!\3).))\3)?[^<])(.*?)" Pleas not another answer "use existing xml parser". Question is - are the regexes proper or not? This is specific situation - C language in embedded system and xml is not well-formed (cannot be fixed - does not depend on me). Xml have specified schema and no problem with namespaces etc. exists.

    Read the article

< Previous Page | 153 154 155 156 157 158 159 160 161 162 163 164  | Next Page >