Search Results

Search found 4118 results on 165 pages for 'attributes'.

Page 5/165 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Custom attributes in Active Directory - determining usage/function and possible removal options?

    - by HopelessN00b
    I've bumped into a highly-customized Active Directory environment (2003 FL) that's got me wondering if there's any particularly easy way to figure out what a custom attribute's function is, and what, if anything, is "using" that particular attribute. And then what some good options for potentially removing custom attributes from the schema might be. Aside from a restore or starting from scratch. If such an option exists. For example, I think I can be fairly certain what the "isDumbass" attribute with a value of TRUE means, but not so much with "IRPextCONST", containing a value of 393684. Likewise, I'd think it should be pretty safe to delete the "isDumbass" attribute, but would like to a) be sure and b) find out what's querying or updating that value anyway, because I suspect that anything using that attribute might be next on the list of things to remove. Ideally, without having to run a search on the contents of every custom script and bit of source code I can get my hands on, of course. And finally, aside from rebuilding from scratch, or doing an authoritative AD restore from backups that don't exist... is there a way to delete a given custom attribute? (Not blank the value, but actually delete the attribute from the schema - some folks would rather not have attributes like "FaggotMeter" and "DouchebagCounter" hanging around.) I've been able to find and successfully test a method on Windows 2k, but it seems like Microsoft disabled this option in SP4, and the domain in question is a 2003 functional level.

    Read the article

  • How do I initialize attributes when I instantiate objects in Rails?

    - by nfm
    Clients have many Invoices. Invoices have a number attribute that I want to initialize by incrementing the client's previous invoice number. For example: @client = Client.find(1) @client.last_invoice_number > 14 @invoice = @client.invoices.build @invoice.number > 15 I want to get this functionality into my Invoice model, but I'm not sure how to. Here's what I'm imagining the code to be like: class Invoice < ActiveRecord::Base ... def initialize(attributes = {}) client = Client.find(attributes[:client_id]) attributes[:number] = client.last_invoice_number + 1 client.update_attributes(:last_invoice_number => client.last_invoice_number + 1) end end However, attributes[:client_id] isn't set when I call @client.invoices.build. How and when is the invoice's client_id initialized, and when can I use it to initialize the invoice's number? Can I get this logic into the model, or will I have to put it in the controller?

    Read the article

  • Adding additional sorting attributes to array of records...then sorting!

    - by keruilin
    Let's say I run an ActiveRecord query and it returns 3 results, with a bunch of attributes. I want to add 3 attributes to each record in the Array so I can do sorting at a code-level. These 3 include: num_comments, num_views, last_view. How do I add these attributes? How do I then sort the records, in order of precendence, by num_comments AND by num_views AND by last_view?

    Read the article

  • Passing multiple Vertex Attributes in GLSL 130

    - by Roy T.
    (note this question is closely related to this one however I didn't fully understand the accepted answer) To support videocards in laptops I have to rewrite my GLSL 330 shaders to GLSL 130. I'm trying to do this but somehow I don't get vertex attributes to work properly. My 330 shaders look like this: #version 330 layout(location = 0) in vec4 position; layout(location = 3) in vec4 color; smooth out vec4 theColor; void main() { gl_Position = position; theColor = color; } Now this explicit layout is not allowed in GLSL 130 so I referenced this page to see what the default layouts for some values would be. As you can see position should be the 0th vertex attribute and color should be the 3rd vertex attribute. Because this is a test case I had already configured my explicit layouts in the same way, which worked, so I now simply rewrote my shader to this and expected it to work: #version 130 smooth out vec4 theColor; void main() { gl_Position = gl_Vertex; theColor = gl_Color; } However this doesn't work, the value of gl_Color is always (1,1,1,1). So how should I pass multiple vertex attributes to my GLSL 130 shaders? For reference, this is how I set my vertex buffer object and attributes (I've just adapted this tutorial to JAVA+JOGL) gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, vertex_buffer_id); gl.glEnableVertexAttribArray(0); gl.glEnableVertexAttribArray(3); gl.glVertexAttribPointer(0, 4 , GL3.GL_FLOAT, false, 0, 0); gl.glVertexAttribPointer(3, 4, GL3.GL_FLOAT, false, 0, 4*4*4); gl.glDrawArrays(GL3.GL_TRIANGLE_STRIP, 0, 4); gl.glDisableVertexAttribArray(0); gl.glDisableVertexAttribArray(3); EDIT I solved the problem by querying for the layout locations of position an color using glGetAttribLocation however I still don't understand why the 'hardcoded' values like gl_Color didn't work, can't I upload data in there as normal? Shouldn't they be used?

    Read the article

  • EF4 Code First Control Unicode and Decimal Precision, Scale with Attributes

    - by Dane Morgridge
    There are several attributes available when using code first with the Entity Framework 4 CTP5 Code First option.  When working with strings you can use [MaxLength(length)] to control the length and [Required] will work on all properties.  But there are a few things missing. By default all string will be created using unicode so you will get nvarchar instead of varchar.  You can change this using the fluent API or you can create an attribute to make the change.  If you have a lot of properties, the attribute will be much easier and require less code. You will need to add two classes to your project to create the attribute itself: 1: public class UnicodeAttribute : Attribute 2: { 3: bool _isUnicode; 4:  5: public UnicodeAttribute(bool isUnicode) 6: { 7: _isUnicode = isUnicode; 8: } 9:  10: public bool IsUnicode { get { return _isUnicode; } } 11: } 12:  13: public class UnicodeAttributeConvention : AttributeConfigurationConvention<PropertyInfo, StringPropertyConfiguration, UnicodeAttribute> 14: { 15: public override void Apply(PropertyInfo memberInfo, StringPropertyConfiguration configuration, UnicodeAttribute attribute) 16: { 17: configuration.IsUnicode = attribute.IsUnicode; 18: } 19: } The UnicodeAttribue class gives you a [Unicode] attribute that you can use on your properties and the UnicodeAttributeConvention will tell EF how to handle the attribute. You will need to add a line to the OnModelCreating method inside your context for EF to recognize the attribute: 1: protected override void OnModelCreating(System.Data.Entity.ModelConfiguration.ModelBuilder modelBuilder) 2: { 3: modelBuilder.Conventions.Add(new UnicodeAttributeConvention()); 4: base.OnModelCreating(modelBuilder); 5: } Once you have this done, you can use the attribute in your classes to make sure that you get database types of varchar instead of nvarchar: 1: [Unicode(false)] 2: public string Name { get; set; }   Another option that is missing is the ability to set the precision and scale on a decimal.  By default decimals get created as (18,0).  If you need decimals to be something like (9,2) then you can once again use the fluent API or create a custom attribute.  As with the unicode attribute, you will need to add two classes to your project: 1: public class DecimalPrecisionAttribute : Attribute 2: { 3: int _precision; 4: private int _scale; 5:  6: public DecimalPrecisionAttribute(int precision, int scale) 7: { 8: _precision = precision; 9: _scale = scale; 10: } 11:  12: public int Precision { get { return _precision; } } 13: public int Scale { get { return _scale; } } 14: } 15:  16: public class DecimalPrecisionAttributeConvention : AttributeConfigurationConvention<PropertyInfo, DecimalPropertyConfiguration, DecimalPrecisionAttribute> 17: { 18: public override void Apply(PropertyInfo memberInfo, DecimalPropertyConfiguration configuration, DecimalPrecisionAttribute attribute) 19: { 20: configuration.Precision = Convert.ToByte(attribute.Precision); 21: configuration.Scale = Convert.ToByte(attribute.Scale); 22:  23: } 24: } Add your line to the OnModelCreating: 1: protected override void OnModelCreating(System.Data.Entity.ModelConfiguration.ModelBuilder modelBuilder) 2: { 3: modelBuilder.Conventions.Add(new UnicodeAttributeConvention()); 4: modelBuilder.Conventions.Add(new DecimalPrecisionAttributeConvention()); 5: base.OnModelCreating(modelBuilder); 6: } Now you can use the following on your properties: 1: [DecimalPrecision(9,2)] 2: public decimal Cost { get; set; } Both these options use the same concepts so if there are other attributes that you want to use, you can create them quite simply.  The key to it all is the PropertyConfiguration classes.   If there is a class for the datatype, then you should be able to write an attribute to set almost everything you need.  You could also create a single attribute to encapsulate all of the possible string combinations instead of having multiple attributes on each property. All in all, I am loving code first and having attributes to control database generation instead of using the fluent API is huge and saves me a great deal of time.

    Read the article

  • Why does diskpart set the volume attributes on all volumes?

    - by Nick
    I was trying to migrate a Win7 OS from a HDD to a SSD. I've created 2 partition with 1024KB offset, with diskpart: 100MB System Reserved and a 60GB for C:. I've cloned their contents using Easeus Disk Copy. I've loaded the Windows 7 Boot DVD, and wanted to use diskpart to drop the letter for the System Reserved partition and make it hidden. select volume 0 detail volume attribute volume set nodefaultdriveletter attribute volume set hidden These 2 attribute set commands actioned on both volumes (0 and 1, MSR and C:) instead of the selected one, and viceversa. I've tried to clear these attributes from volume 1, but it cleared them also from volume 0. Why does DiskPart have this behaviour?

    Read the article

  • Magento: add product twice to cart, with different attributes!

    - by Peter
    Hello all, i have been working with this for a whole day but i cannot find any solution: I have a product (lenses), which has identical attributes, but user can choose one attribute set for one eye and another attribute set for another. On the frontend i got it ok, see it here: http://connecta.si/clarus/index.php/featured/acuvue-oasys-for-astigmatism.html So the user can select attributes for left or right eye, but it is the same product. I build a function, wich should take a product in a cart (before save), add other set of attributes, so there should be two products in the cart. What happens is there are two products, but with the same set of attributes??? Here is the snippet of the function: $req = Mage::app()-getRequest(); $request[’qty’] = 1; $request[’product’] = 15; $request[’uenc’] = $req-get(’uenc’); $request[’options’][1] = 1; $request[’options’][3] = 5; $request[’options’][2] = 3; $reqo = new Varien_Object($request); $newitem = $quote-addProduct($founditem-getProduct(), $reqo); //add another one ------------------------------------------ $request[’qty’] = 1; $request[’product’] = 15; $request[’uenc’] = $req-get(’uenc’); $request[’options’][1] = 2; $request[’options’][3] = 6; $request[’options’][2] = 4; $reqo = new Varien_Object($request); $newitem = $quote-addProduct($founditem-getProduct(), $reqo); Or another test, with some other functions (again, product added, with 2 quantity , but same attributes...): $req = Mage::app()-getRequest(); $request[’qty’] = 1; $request[’product’] = 15; $request[’uenc’] = $req-get(’uenc’); $request[’options’][1] = 2; $request[’options’][3] = 6; $request[’options’][2] = 4; $product = $founditem-getProduct(); $cart = Mage::getSingleton(’checkout/cart’); //delete all first… $cart-getItems()-clear()-save(); $reqo = new Varien_Object($request); $cart-addProduct($founditem-getProduct(), $reqo); $cart-getItems()-save(); $request[’options’][1] = 1; $request[’options’][3] = 5; $request[’options’][2] = 3; $reqo = new Varien_Object($request); $cart-addProduct($founditem-getProduct(), $reqo); $cart-getItems()-save(); i really dont know what more to do, please any advice, this is my first module in magento… thank you, Peter

    Read the article

  • Need software to convert RAR to ZIP ("store" mode - no compression) * Extract->re-archive changes date/time attributes

    - by Larry78
    I have tried all of the following applications (download.cnet.com - the free ones), and none of them will convert an RAR archive to a ZIP, without compressing the files ("store" mode). 7-ZIP would be fine, too. [The RAR is a "solid" archive with password (I know it), files "stored" - no compression, used WinRAR 3.5.1] PeaZip, 7-Zip, FilZip, TugZip, SimplyZipSE, QuickZip, WinShrink. (A couple of the apps let you try, but the program gives an error - indicating how bad the software is. (Like "unknown header # #.") None of these apps will do the conversion at all. IZArc 4.1 comes the closest. It will convert an RAR to a ZIP, but it compresses the zip. There is a general preference setting to "store" - but it doesn't effect conversions. I don't want to extract the RAR files and re-archive them because I need to preserve the modified/created file attributes. IZArc preserves them, but it compresses the files. WinRAR has the option to convert archives, but I get the error "skipping encryped archive" when I try to convert it. It asks for the password first, and I know it's right because that password opens the archive, and I can read/view all the files in the archive.

    Read the article

  • Are there any other ways to iterate through the attributes of a custom class, excluding the in-built ones?

    - by Ricardo Altamirano
    Is there another way to iterate through only the attributes of a custom class that are not in-built (e.g. __dict__, __module__, etc.)? For example, in this code: class Terrain: WATER = -1 GRASS = 0 HILL = 1 MOUNTAIN = 2 I can iterate through all of these attributes like this: for key, value in Terrain.__dict__.items(): print("{: <11}".format(key), " --> ", value) which outputs: MOUNTAIN --> 2 __module__ --> __main__ WATER --> -1 HILL --> 1 __dict__ --> <attribute '__dict__' of 'Terrain' objects> GRASS --> 0 __weakref__ --> <attribute '__weakref__' of 'Terrain' objects> __doc__ --> None If I just want the integer arguments (a rudimentary version of an enumerated type), I can use this: for key, value in Terrain.__dict__.items(): if type(value) is int: # type(value) == int print("{: <11}".format(key), " --> ", value) this gives the expected result: MOUNTAIN --> 2 WATER --> -1 HILL --> 1 GRASS --> 0 Is it possible to iterate through only the non-in-built attributes of a custom class independent of type, e.g. if the attributes are not all integral. Presumably I could expand the conditional to include more types, but I want to know if there are other ways I'm missing.

    Read the article

  • Grant account write access to specific attributes on Active Directory User object

    - by Patricker
    I am trying to allow an account to update very specific attributes on all User objects. I am setting this security on the "User" object. When I add the account on the security tab, go to advanced, edit the accounts permissions, and start going through the list of attributes I am only able to find a few, like First Name, but most of the attributes I want to let them write to are missing. How can I grant the account write access to these attributes? Attributes I need to grant permission for: First Name (givenName) Last Name (sn) Initials (initials) Department (department) Company (company) Title (title) Manager (manager) Location Info (physicalDeliveryOfficeName, streetAddress, postOfficeBox) Work Phone (telephoneNumber) Pager (pager) IP Phone (ipPhone) IP Phone Other (otherIpPhone) ThumbnailLogo (thumbnailLogo) jpegPhoto (jpegPhoto) Description (displayName) Thanks

    Read the article

  • Jquery: Create hidden attributes? I need to reduce tag bulkyness.

    - by Dan
    I'm sure we've all done this before: <a id="232" rel="link_to_user" name="user_details" class="list hoverable clickable selectable"> USER #232 </a> But then we say, oh my, I need more ways to store tracking info about this div! <a id="232-343-22" rel="link_to_user:fotomeshed" name="user_details" class="groupcolor-45 elements-698 list hoverable clickable selectable"> User: John Doe </a> And the sickness keeps growing. We just keep on packing it inside that poor little element and it's attributes. All so we can keep track of who it is. So with my limited knowledge of JS, someone please tell me how to do something like this: <a id="33">USER #33</a> $(#33).attr({title:'User Record','username':'john', 'group_color':'green', 'element_num':78}); So here we just added what I would call invisible attributes, because we just played God and made those attributes up on the fly like it was no problem. The cool part is that these would be kept in their own little object somewhere in variable land. NOT in the tag itself. Then later on, in a code nested far far away, be able to say, oh, i wonder what group_color John is... user_group_color = $(table).find(a['username':'john']).attr('group_color'); THEN BAM!!!! POW!!!! alert(user_group_color + " is a bitchin color!"); You get to know his group color... all without adding a bunch of bloated element tracking nonsense into our tags. So does this sort of thing exist? If not, how do I make it?

    Read the article

  • How do you parse with SAX using Attributes & Values to a URL path using iPhone SDK?

    - by Jim
    I'm trying to get my head around parsing with SAX and thought a good place to start was the TopSongs example found at the iPhone Dev Center. I get most of it but when it comes to reaching Attributes and Values within a node I can't find a good example anywhere. The XML has a path to a URL for the coverArt. And the XML node looks like this. <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/us/r1000/026/Music/aa/aa/27/mzi.pbxnbfvw.60x60-50.jpg</itms:coverArt> What I've tried is this for the startElement… ((prefix != NULL && !strncmp((const char *)prefix, kName_Itms, kLength_Itms)) && (!strncmp((const char *)localname, kName_CoverArt, kLength_Item) && !strncmp((const char *)attributes, kAttributeName_CoverArt, kAttributeLength_CoverArt) && !strncmp((const char *)attributes, kValueName_CoverArt, kValueLength_CoverArt) || !strncmp((const char *)localname, kName_Artist, kLength_Artist) || and picking it up again with just the localname at the end like this. if (!strncmp((const char *)localname, kName_CoverArt, kLength_CoverArt)) { importer.currentSong.coverArt = [NSURL URLWithString:importer.currentString]; The trace is -[Song setCoverArt:]: unrecognized selector sent to instance.

    Read the article

  • How to "DRY up" C# attributes in Models and ViewModels?

    - by DanM
    This question was inspired by my struggles with ASP.NET MVC, but I think it applies to other situations as well. Let's say I have an ORM-generated Model and two ViewModels (one for a "details" view and one for an "edit" view): Model public class FooModel // ORM generated { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string EmailAddress { get; set; } public int Age { get; set; } public int CategoryId { get; set; } } Display ViewModel public class FooDisplayViewModel // use for "details" view { [DisplayName("ID Number")] public int Id { get; set; } [DisplayName("First Name")] public string FirstName { get; set; } [DisplayName("Last Name")] public string LastName { get; set; } [DisplayName("Email Address")] [DataType("EmailAddress")] public string EmailAddress { get; set; } public int Age { get; set; } [DisplayName("Category")] public string CategoryName { get; set; } } Edit ViewModel public class FooEditViewModel // use for "edit" view { [DisplayName("First Name")] // not DRY public string FirstName { get; set; } [DisplayName("Last Name")] // not DRY public string LastName { get; set; } [DisplayName("Email Address")] // not DRY [DataType("EmailAddress")] // not DRY public string EmailAddress { get; set; } public int Age { get; set; } [DisplayName("Category")] // not DRY public SelectList Categories { get; set; } } Note that the attributes on the ViewModels are not DRY--a lot of information is repeated. Now imagine this scenario multiplied by 10 or 100, and you can see that it can quickly become quite tedious and error prone to ensure consistency across ViewModels (and therefore across Views). How can I "DRY up" this code? Before you answer, "Just put all the attributes on FooModel," I've tried that, but it didn't work because I need to keep my ViewModels "flat". In other words, I can't just compose each ViewModel with a Model--I need my ViewModel to have only the properties (and attributes) that should be consumed by the View, and the View can't burrow into sub-properties to get at the values. Update LukLed's answer suggests using inheritance. This definitely reduces the amount of non-DRY code, but it doesn't eliminate it. Note that, in my example above, the DisplayName attribute for the Category property would need to be written twice because the data type of the property is different between the display and edit ViewModels. This isn't going to be a big deal on a small scale, but as the size and complexity of a project scales up (imagine a lot more properties, more attributes per property, more views per model), there is still the potentially for "repeating yourself" a fair amount. Perhaps I'm taking DRY too far here, but I'd still rather have all my "friendly names", data types, validation rules, etc. typed out only once.

    Read the article

  • While using an ntfs smb share for mac users, do symbolic links and extended attributes work?

    - by scape
    We have a majority of mac users but we'd rather support their file sharing using a Windows server with an ntfs drive, or at least a Linux server with ext3. We've had trouble, much trouble, utilizing the OS X server software and after the years are now looking to abandon it. What's mostly holding us back is the fact that the mac users very often utilize symbolic links and other special features that exist for an HFS+ partition. The shared locations are mostly primary storage and not just used as an archive storage location. While there is an option to create symbolic links under ntfs, I'm curious if there is anything I need to look out for if I were to move the files over to a new partition that's hosted from a Windows server from the HFS+ partition; in addition, how well creating a symbolic link from a mac might work. I am also worried about windows backup software and if it will ruin these special sym links, and how placing permissions on sub-folders will work. Alternatively I could remotely backup the files using a mac and Bru, nonetheless I still want to get away from mac server for hosting the shares.

    Read the article

  • How to Use Heading Tags and Alt Attributes

    If you're working with HTML code for the first time, you may be wondering why Heading tags and alt attributes are used as a guide to data within your site's architecture. Search Engine Optimization consultants use HTML header tags to summarize the topic of the page it introduces. Google and other search engines analyze text inside header tags in their algorithm to assign web page rankings. To rank for your target keywords and phrases, incorporate them into your HTML page headers.

    Read the article

  • In DOM is it OK to use .notation for getting/setting attributes?

    - by Ziggy
    Hi In DOM, is it OK to refer to an element's attributes like this: var universe = document.getElementById('universe'); universe.origin = 'big_bang'; universe.creator = null; universe.style.deterministic = true; ? My deep respect for objects and their privacy, and my sense that things might go terribly wrong if I am not careful, makes me want to do everything more like this: var universe = document.getElementById('universe'); if(universe.hasAttribute('origin')) then universe.origin = 'big_bang'; etc... Is it really necessary to use those accessor methods? Of course it may be more or less necessary depending on how certain I am that the elements I am manipulating will have the attributes I expect them to, but in general do the DOM guys consider it OK to use .notation rather than getters and setters? Thanks!

    Read the article

  • Extended Logging with Caller Info Attributes

    - by João Angelo
    .NET 4.5 caller info attributes may be one of those features that do not get much airtime, but nonetheless are a great addition to the framework. These attributes will allow you to programmatically access information about the caller of a given method, more specifically, the code file full path, the member name of the caller and the line number at which the method was called. They are implemented by taking advantage of C# 4.0 optional parameters and are a compile time feature so as an added bonus the returned member name is not affected by obfuscation. The main usage scenario will be for tracing and debugging routines as will see right now. In this sample code I’ll be using NLog, but the example is also applicable to other logging frameworks like log4net. First an helper class, without any dependencies and that can be used anywhere to obtain caller information: using System; using System.IO; using System.Runtime.CompilerServices; public sealed class CallerInfo { private CallerInfo(string filePath, string memberName, int lineNumber) { this.FilePath = filePath; this.MemberName = memberName; this.LineNumber = lineNumber; } public static CallerInfo Create( [CallerFilePath] string filePath = "", [CallerMemberName] string memberName = "", [CallerLineNumber] int lineNumber = 0) { return new CallerInfo(filePath, memberName, lineNumber); } public string FilePath { get; private set; } public string FileName { get { return this.fileName ?? (this.fileName = Path.GetFileName(this.FilePath)); } } public string MemberName { get; private set; } public int LineNumber { get; private set; } public override string ToString() { return string.Concat(this.FilePath, "|", this.MemberName, "|", this.LineNumber); } private string fileName; } Then an extension class specific for NLog Logger: using System; using System.Runtime.CompilerServices; using NLog; public static class LoggerExtensions { public static void TraceMemberEntry( this Logger logger, [CallerFilePath] string filePath = "", [CallerMemberName] string memberName = "", [CallerLineNumber] int lineNumber = 0) { LogMemberEntry(logger, LogLevel.Trace, filePath, memberName, lineNumber); } public static void TraceMemberExit( this Logger logger, [CallerFilePath] string filePath = "", [CallerMemberName] string memberName = "", [CallerLineNumber] int lineNumber = 0) { LogMemberExit(logger, LogLevel.Trace, filePath, memberName, lineNumber); } public static void DebugMemberEntry( this Logger logger, [CallerFilePath] string filePath = "", [CallerMemberName] string memberName = "", [CallerLineNumber] int lineNumber = 0) { LogMemberEntry(logger, LogLevel.Debug, filePath, memberName, lineNumber); } public static void DebugMemberExit( this Logger logger, [CallerFilePath] string filePath = "", [CallerMemberName] string memberName = "", [CallerLineNumber] int lineNumber = 0) { LogMemberExit(logger, LogLevel.Debug, filePath, memberName, lineNumber); } public static void LogMemberEntry( this Logger logger, LogLevel logLevel, [CallerFilePath] string filePath = "", [CallerMemberName] string memberName = "", [CallerLineNumber] int lineNumber = 0) { const string MsgFormat = "Entering member {1} at line {2}"; InternalLog(logger, logLevel, MsgFormat, filePath, memberName, lineNumber); } public static void LogMemberExit( this Logger logger, LogLevel logLevel, [CallerFilePath] string filePath = "", [CallerMemberName] string memberName = "", [CallerLineNumber] int lineNumber = 0) { const string MsgFormat = "Exiting member {1} at line {2}"; InternalLog(logger, logLevel, MsgFormat, filePath, memberName, lineNumber); } private static void InternalLog( Logger logger, LogLevel logLevel, string format, string filePath, string memberName, int lineNumber) { if (logger == null) throw new ArgumentNullException("logger"); if (logLevel == null) throw new ArgumentNullException("logLevel"); logger.Log(logLevel, format, filePath, memberName, lineNumber); } } Finally an usage example: using NLog; internal static class Program { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static void Main(string[] args) { Logger.TraceMemberEntry(); // Compile time feature // Next three lines output the same except for line number Logger.Trace(CallerInfo.Create().ToString()); Logger.Trace(() => CallerInfo.Create().ToString()); Logger.Trace(delegate() { return CallerInfo.Create().ToString(); }); Logger.TraceMemberExit(); } } NOTE: Code for helper class and Logger extension also available here.

    Read the article

  • Why won't title attributes get indexed in Google?

    - by Sam
    When I search for Ride On + my site's name, I see that it's indexed. But when I search for Green Horse + my site's name, I don't see my site appearing in the results anywhere! Here's my code: <td><a href="#" title="Green Horse Ride">Ride On</a></td> Does this mean that title attributes are not indexed/shown by Google at all? What is better to use, alt? What are the other alternatives except title and alt?

    Read the article

  • Attributes and Behaviours in game object design

    - by Brukwa
    Recently I have read interesting slides about game object design written by Marcin Chady Theory and Practice of the Game Object Component Architecture. I have prototyped quick sample that utilize all Attributes\Behaviour idea with some sample data. Now I have faced a little problem when I added a RenderingSystem to my prototype application. I have created an object with RenderBehaviour which listens for messages (OnMessage function) like MovedObject in order to mark them as invalid and in OnUpdate pass I am inserting a new renderable object to rederer queue. I have noticed that rendering updates should be the last thing made in single frame and this causes RenderBehaviour to depend on any other Behaviour that changes object position (i.ex. PhysicsSystem and PhysicsBehaviour). I am not even sure if I am doing this the way it should be. Do you have any clues that might put me on the right track?

    Read the article

  • Using "public" vars or attributes in class calls, functional approach

    - by marw
    I was always wondering about two things I tend to do in my little projects. Sometimes I will have this design: class FooClass ... self.foo = "it's a bar" self._do_some_stuff(self) def _do_some_stuff(self): print(self.foo) And sometimes this one: class FooClass2 ... self.do_some_stuff(foo="it's a bar") def do_some_stuff(self, foo): print(foo) Although I roughly understand the differences between functional and class approaches, I struggle with the design. For example, in FooClass the self.foo is always accessible as an attribute. If there are numerous calls to it, is that faster than making foo a local variable that is passed from method to method (like in FooClass2)? What happens in memory in both cases? If FooClass2 is preferred (ie. I don't need to access foo) and other attributes inside do not change their states (the class is executed once only and returns the result), should the code then be written as a series of functions in a module?

    Read the article

  • MAC OSX Mavericks, using bash to see "Get Info" attributes

    - by Rell3oT
    I want to use my bash shell to see the attributes that are shown when you right click on an Application and click Get Info. The specific attributes that I want to know whether or not they are checked is Open in Low Resolution, Prevent App Nap, and Locked. I looked in the Info.plist file but only generic information about the file was contained here, not which attributes were checked. Is this information contained in the Applications binary? Where is it?

    Read the article

  • Control Attributes render Encoded on dot net 4 - how to disable the encoding ?

    - by Aristos
    I have an issue in asp.net 4. When I add an attribute on controls, then the render it encoded. For example, when I type this code txtQuestion.Attributes["onfocus"] = "if(this.value == this.title) { this.value = ''; this.style.backgroundColor='#FEFDE0'; this.style.color='#000000'; }"; I get render onfocus="if(this.value == this.title){this.value = &#39;&#39;;this.style.backgroundColor=&#39;#FEFDE0&#39;; this.style.color=&#39;#000000&#39;;}" And every ' hash been change to & #39; Is there a way to disable this new future only on some controls ? or an easy way to make a custom render ? My Fail tries I have all ready try some thinks but I fail. For example this fails. txtQuestion.RenderingCompatibility = new Version("3.5"); I also locate the point that this attributes renders and is on public virtual void RenderBeginTag(HtmlTextWriterTag tagKey) function, there every attribute have a flag if he wish to be encoded, but I do not know how can anyone set it or not. Anyway, thank you in advanced.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >