Search Results

Search found 40915 results on 1637 pages for 'property list'.

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

  • Truly understand the threshold for document set in document library in SharePoint

    - by ybbest
    Recently, I am working on an issue with threshold. The problem is that when the user navigates to a view of the document library, it displays the error message “list view threshold is exceeded”. However, in the view, it has no data. The list view threshold limit is 5000 by default for the non-admin user. This limit is not the number of items returned by your query; it is the total number of items the database needs to read to calculate the returned result set. So although the view does not return any result but to calculate the result (no data to show), it needs to access more than 5000 items in the database. To fix the issue, you need to create an index for the column that you use in the filter for the view. Let’s look at the problem in details. You can download a solution to replicate this issue here. 1. Go to Central Admin ==> Web Application Management ==>General Settings==> Click on Resource Throttling 2. Change the list view threshold in web application from 5000 to 2000 so that I can show the problem without loading more than 5000 items into the list. FROM TO 3. Go to the page that displays the approved view of the Loan application document set. It displays the message as shown below although I do not have any data returned for this view. 4. To get around this, you need to create an index column. Go to list settings and click on the Index columns. 5. Click on the “Create a new index” link. 6. Select the LoanStatus field as I use this filed as the filter to create the view. 7. After the index is created now I can access the approved view, as you can see it does not return any data. Notes: List View Threshold: Specify the maximum number of items that a database operation can involve at one time. Operations that exceed this limit are prohibited. References: SharePoint lists V: Techniques for managing large lists Manage large SharePoint lists for better performance http://blogs.technet.com/b/speschka/archive/2009/10/27/working-with-large-lists-in-sharepoint-2010-list-throttling.aspx

    Read the article

  • SEO: Nested List vs List, Split Over Divs vs Definition List

    - by Jon P
    From an SEO perspective which, if any, is better: Option 1: Nested lists with h2 tags <ul id="mainpoints"> <li><h2>Powerful Analysis</h2> <ul> <li>Charting and indicators</li> <li>Daily trading signals</li> <li>Company health checks</li> </ul> </li> <li><h2>World Market Data</h2> <ul> [List Items removed for brevity] </ul> </li> <li><h2>Daily Market Data</h2> <ul> [List Items removed for brevity] </ul> </li> </ul> Option 2: Divs with h2 and lists <div id="mainpoints"> <div> <h2>Powerful Analysis</h2> <ul> <li>Charting and indicators</li> <li>Daily trading signals</li> <li>Company health checks</li> </ul> </div> <div> <h2>World Market Data</h2> <ul> [List Items removed for brevity] </ul> </div> <div> <h2>Daily Market Data</h2> <ul> [List Items removed for brevity] </ul> </div> </div> Option 3: Definition List <dl id="mainpoints"> <dt>Powerful Analysis</dt> <dd>- Charting and indicators</dd> <dd>- Daily trading signals</dd> <dd>- Company health checks</dd> <dt>World Market Data</dt> [List Items removed for brevity] <dt>Daily Market Data</dt> [List Items removed for brevity] </dl> My instincts tell me that semanticaly the pure list options (1 & 3) are the best and that h2 may be more SEO friendly (1 & 2) which would point to option 1 as being the best option. I do love the lean makeup of the definition list but will I take an SEO hit by losing the h2 tags? Before anyone asks, h2 is not valid markup in a dt tag. Are my instincts right with a nested list being the way to go?

    Read the article

  • kernel module compiling error

    - by wati
    sh@ubuntu:/home/ccpp/helloworld$ make gcc-4.6 -O2 -DMODULE -D_KERNEL_ -W -Wall -Wstrict-prototypes -Wmissing-prototypes -isystem /lib/modules/`uname -r`/build/include -c -o hello-1.o hello-1.c hello-1.c:4:0: warning: "MODULE" redefined [enabled by default] <command-line>:0:0: note: this is the location of the previous definition hello-1.c:6:0: warning: "_KERNEL_" redefined [enabled by default] <command-line>:0:0: note: this is the location of the previous definition In file included from /lib/modules/3.2.0-25-generic/build/include/linux/list.h:4:0, from /lib/modules/3.2.0-25-generic/build/include/linux/module.h:9, from hello-1.c:7: /lib/modules/3.2.0-25-generic/build/include/linux/types.h:13:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders" [-Wcpp] In file included from /lib/modules/3.2.0-25-generic/build/include/linux/module.h:9:0, from hello-1.c:7: /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘INIT_LIST_HEAD’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:26:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:27:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__list_add’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:41:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:42:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:43:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:44:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_add’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:62:28: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_add_tail’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:76:22: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__list_del’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:88:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:89:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__list_del_entry’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:101:18: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:101:31: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_del’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:106:18: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:106:31: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:107:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:108:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_replace’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:125:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:125:17: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:126:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:127:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:127:17: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:128:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_is_last’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:179:13: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_empty’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:188:13: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_empty_careful’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:206:31: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:207:40: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_rotate_left’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:219:15: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_is_singular’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:230:35: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:230:49: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__list_cut_position’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:236:37: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:237:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:237:19: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:238:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:239:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:240:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:241:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:242:11: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_cut_position’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:265:8: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__list_splice’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:277:32: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:278:31: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:280:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:281:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:283:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:284:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_splice’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:296:33: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_splice_tail’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:308:27: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_splice_init’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:322:33: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘list_splice_tail_init’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:339:27: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘INIT_HLIST_NODE’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:572:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:573:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_unhashed’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:578:11: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_empty’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:583:11: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘__hlist_del’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:588:29: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:589:31: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:592:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_del’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:598:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:599:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_add_head’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:612:30: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:613:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:615:8: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:615:20: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:616:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:617:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:617:15: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_add_before’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:624:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:624:17: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:625:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:626:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:626:18: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:627:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_add_after’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:633:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:633:16: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:634:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:635:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:635:18: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:637:9: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:638:7: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:638:29: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_add_fake’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:644:3: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:644:15: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h: In function ‘hlist_move_list’: /lib/modules/3.2.0-25-generic/build/include/linux/list.h:654:5: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:654:18: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:655:9: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:656:6: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:656:27: error: dereferencing pointer to incomplete type /lib/modules/3.2.0-25-generic/build/include/linux/list.h:657:5: error: dereferencing pointer to incomplete type In file included from /lib/modules/3.2.0-25-generic/build/include/linux/module.h:12:0, from hello-1.c:7: /lib/modules/3.2.0-25-generic/build/include/linux/cache.h: At top level: /lib/modules/3.2.0-25-generic/build/include/linux/cache.h:5:23: fatal error: asm/cache.h: No such file or directory compilation terminated. make: *** [hello-1.o] Error 1 i got this error after compiling an helloworld program my program is #define MODULE #define LINUX #define _KERNEL_ #include <linux/module.h> #include <linux/kernel.h> int init_module(void) { printk("<1>hello World 1.\n"); return 0; } void cleanup_module(void) { printk(KERN_ALERT "goodbye world 1.\n"); } MODULE_LICENSE("GPL"); my make file is: TARGET := hello-1 WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes INCLUDE := -isystem /lib/modules/`uname -r`/build/include CFLAGS := -O2 -DMODULE -D_KERNEL_ ${WARN} ${INCLUDE} CC := gcc-4.6 ${TARGET}.o: ${TARGET}.c .PHONY: clean clean: rm -rf ${TARGET}.o iam usin kernel 3.2.0.25 as novice i can't able to figure out where the problem is I SEARCHED EVERY THING I CAN TO KNOW ABOUT THIS ERROR BUT I CANT UNDERSTAND &I GET IRRELEVANT DOCS anybody help me please

    Read the article

  • Python Glade could not create GladeXML Object

    - by Peter
    Hey, I've created a simple window GUI in Glade 3.6.7 and I am trying to import it into Python. Every time I try to do so I get the following error: (queryrelevanceevaluation.py:8804): libglade-WARNING **: Expected <glade-interface>. Got <interface>. (queryrelevanceevaluation.py:8804): libglade-WARNING **: did not finish in PARSER_FINISH state Traceback (most recent call last): File "queryrelevanceevaluation.py", line 17, in <module> app = QueryRelevanceEvaluationApp() File "queryrelevanceevaluation.py", line 10, in __init__ self.widgets = gtk.glade.XML(gladefile) RuntimeError: could not create GladeXML object My Python Code: #!/usr/bin/env python import gtk import gtk.glade class QueryRelevanceEvaluationApp: def __init__(self): gladefile = "foo.glade" self.widgets = gtk.glade.XML(gladefile) dic = {"on_buttonGenerate_clicked" : self.on_buttonGenerate_clicked} self.widgets.signal_autoconnect(dic) def on_buttonGenerate_clicked(self, widget): print "You clicked the button" app = QueryRelevanceEvaluationApp() gtk.main() And the foo.glade file: <?xml version="1.0"?> <interface> <requires lib="gtk+" version="2.16"/> <!-- interface-naming-policy project-wide --> <object class="GtkWindow" id="windowRelevanceEvaluation"> <property name="visible">True</property> <property name="title" translatable="yes">Query Result Relevance Evaluation</property> <child> <object class="GtkVBox" id="vbox1"> <property name="visible">True</property> <property name="orientation">vertical</property> <child> <object class="GtkHBox" id="hbox2"> <property name="visible">True</property> <child> <object class="GtkLabel" id="labelQuery"> <property name="visible">True</property> <property name="label" translatable="yes">Query:</property> </object> <packing> <property name="expand">False</property> <property name="padding">4</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkEntry" id="entry1"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">&#x25CF;</property> </object> <packing> <property name="padding">4</property> <property name="position">1</property> </packing> </child> </object> <packing> <property name="position">0</property> </packing> </child> <child> <object class="GtkFrame" id="frameSource"> <property name="visible">True</property> <property name="label_xalign">0</property> <child> <object class="GtkAlignment" id="alignment1"> <property name="visible">True</property> <property name="left_padding">12</property> <child> <object class="GtkHButtonBox" id="hbuttonbox1"> <property name="visible">True</property> <child> <object class="GtkRadioButton" id="radiobuttonGoogle"> <property name="label" translatable="yes">Google</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="active">True</property> <property name="draw_indicator">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkRadioButton" id="radiobuttonBing"> <property name="label" translatable="yes">Bing</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="active">True</property> <property name="draw_indicator">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">1</property> </packing> </child> <child> <object class="GtkRadioButton" id="radiobuttonBoden"> <property name="label" translatable="yes">Boden</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="active">True</property> <property name="draw_indicator">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">2</property> </packing> </child> <child> <object class="GtkRadioButton" id="radiobuttonCSV"> <property name="label" translatable="yes">CSV</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="active">True</property> <property name="draw_indicator">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">3</property> </packing> </child> </object> </child> </object> </child> <child type="label"> <object class="GtkLabel" id="labelFrameSource"> <property name="visible">True</property> <property name="label" translatable="yes">&lt;b&gt;Source&lt;/b&gt;</property> <property name="use_markup">True</property> </object> </child> </object> <packing> <property name="position">1</property> </packing> </child> <child> <object class="GtkFrame" id="frame1"> <property name="visible">True</property> <property name="label_xalign">0</property> <child> <object class="GtkHBox" id="hbox3"> <property name="visible">True</property> <child> <object class="GtkLabel" id="labelResults"> <property name="visible">True</property> <property name="label" translatable="yes">Number Results:</property> </object> <packing> <property name="expand">False</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkSpinButton" id="spinbuttonResults"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">&#x25CF;</property> </object> <packing> <property name="padding">4</property> <property name="position">1</property> </packing> </child> </object> </child> <child type="label"> <object class="GtkLabel" id="labelFrameResults"> <property name="visible">True</property> <property name="label" translatable="yes">&lt;b&gt;Results&lt;/b&gt;</property> <property name="use_markup">True</property> </object> </child> </object> <packing> <property name="padding">2</property> <property name="position">2</property> </packing> </child> <child> <object class="GtkButton" id="buttonGenerateResults"> <property name="label" translatable="yes">Generate!</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> </object> <packing> <property name="position">3</property> </packing> </child> </object> </child> </object> </interface> foo.glade and the above python script are in the same directory, and I have tried using a fully-qualified path but still get the same error (I am certain that the path is correct!). Any ideas? Cheers, Pete

    Read the article

  • Testing if a list contains another list with Python

    - by None
    How can I test if a list contains another list. Say there was a function called contains: contains([1,2], [-1, 0, 1, 2]) # Returns [2, 3] (contains returns [start, end]) contains([1,3], [-1, 0, 1, 2]) # Returns False contains([1, 2], [[1, 2], 3) # Returns False contains([[1, 2]], [[1, 2], 3]) # Returns [0, 0] Edit: contains([2, 1], [-1, 0, 1, 2]) # Returns False contains([-1, 1, 2], [-1, 0, 1, 2]) # Returns False contains([0, 1, 2], [-1, 0, 1, 2]) # Returns [1, 3]

    Read the article

  • Hover effect for parent unordered list inherited by child list

    - by elvista
    I have a simple menu <ul id="menu"> <li class="leaf"><a href="#">Menu Item 1</a></li> <li class="leaf"><a href="#">Menu Item 2</a></li> <li class="expanded"><a href="#">Menu Item 3</a> <ul> <li class="leaf"><a href="#">Menu Item a</a></li> <li class="leaf"><a href="#">Menu Item b</a></li> <li class="leaf"><a href="#">Menu Item c</a></li> </ul> </li> <li class="leaf"><a href="#">Menu Item 4</a></li> </ul> and ul#menu li a:hover {font-weight:bold;} The problem I am facing is when I hover above a ul li li, the parent as well as all its siblings gets the hover effect. I only want the list item I hovered above to get the effect. I tried ul#menu li.leaf a: hover {..}, ul#menu li.expanded a: hover {..} , but even in that case, when I hover above li.expanded, it's child inherits the style. How do I fix this?

    Read the article

  • C#: access a class property when the property identifier is known as a string

    - by Hans
    Hi, I'm using LINQ to Entities on a database which structure is not known in advance. I use reflection to retrieve the information, and now have a list of strings with all the table names. Because I use LINQ, I also have the datasource encapsulated in a C# class (linqContext), with each table being a property of that class. What I want to achieve is this: Assume one of the strings in the table names list is "Employees". This is known in code, I want to do the following: linqContext.Employees.DoSomethingHere(); Is this possible? I know that if all the propertie were just items in a list, I could use the string as indexer, linqContext["Employees"]. However, this is not the case :(

    Read the article

  • About Intellectual-Property agreement with employer

    - by turbo
    In IP agreement IP is define as below Intellectual Property (whether or not patentable and whether or not made during working hours) is defined as but not limited to: all product specifications, developments, inventions, works of authorship, derivative works, technologies, programs, systems, software, mobile applications and other mobile programming interfaces, designs, methodologies, encryptions, ideas, techniques, patents, formulas, processes, concepts, know-how and date made or conceived or reduced to practice or developed during employment period ,remain the property of XXXXXXX[COMPANY_NAME]XXXX or its affiliates. This is the first time I have seen any IP agreement. Isn't it too stringent? or its standard practice across industry?

    Read the article

  • Intellectual Property for in house development

    - by Kyle Rogers
    My company is a sub contractor on a major government contract. Over the past 5 years we've been developing in house applications to help support our company and streamline our work. Apparently in 2008 our president of the company at that time signed a continuation of services contract with the company we subcontract with on this project. In the contract amendment various things were discussed such as intellectual property and the creation of new and existing tools. The contract states that all the subcontractor's tools/scripts/etc... become the intellectual property of the main contractor holder. Basically all tools that were created in support of the project which we work on are no longer ours exclusively and they have rights to them. My company really doesn't do software development specifically but because of this contract these tools helped tremendously with our daily tasking. Does my company have any sort of recourse or actions to help keep our tools? My team of developers were completely unaware of any of these negotiations and until recently were kept in the dark about the agreements that were made. Do we as developers have any rights to the software? Since our company is not a software development shop, we have created all these tools without any sort of agreements or contracts within the company stating that we give our company full rights to our creations? I was reading an article by Joel Spolsky on this topic and was just wonder if there is any advice out there to help assist us? Thank you Joel Spolsky's Article

    Read the article

  • understanding list[i-1] vs list[i]-1

    - by user3720527
    Hopefully this is a simple answer that I am just failing to understand. Full code is public static void mystery(int[] list) { for( int i = list.length - 1; i>1; i --) { if (list[i] > list[i - 1]) { list[i -1] = list[i] - 2; list[i]++; } } } } and lets say we are using a list of [2,3,4]. I know that it will output 2,2,5 but I am unclear how to actually work through it. I understand that the list.length is 3 here, and I understand that the for loop will only run once, but I am very unclear what happens at the list[i - 1] = list[i] - 2; area. Should it be list[2-1] = list[2] - 2? How does the two being outside the bracket effect it differently? Much thanks.

    Read the article

  • Segmentation fault when running a python script/GTKBuilder app?

    - by pythonscript
    I'm trying to learn GUI programming using python2 and GTKBuilder, but I get a segmentation fault when I run the code. This is my file, created in Glade as a GTKBuilder file: <?xml version="1.0" encoding="UTF-8"?> <interface> <!-- interface-requires gtk+ 3.0 --> <object class="GtkWindow" id="mainWindow"> <property name="can_focus">False</property> <child> <object class="GtkBox" id="box1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="orientation">vertical</property> <child> <object class="GtkBox" id="box2"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> <property name="margin_left">146</property> <property name="margin_right">276</property> <child> <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">label</property> </object> <packing> <property name="expand">True</property> <property name="fill">False</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkEntry" id="entryName"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="margin_bottom">4</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="invisible_char">?</property> <property name="placeholder_text">Please enter your name here...</property> </object> <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> </child> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkButton" id="buttonWriteNameToFile"> <property name="label" translatable="yes">button</property> <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="use_action_appearance">False</property> <signal name="clicked" handler="buttonWriteNameToFile_clicked" swapped="no"/> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> <property name="position">1</property> </packing> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> </object> </child> </object> </interface> My python code, based on this question, is this: #!/usr/bin/env python import gtk class NameApp: def __init__(self): filename = "project.glade" builder = gtk.Builder() builder.add_from_file(filename) builder.connect_signals(self) builder.get_object("mainWindow").show_all() def buttonWriteNameToFile_clicked(self, widget): print("File write code...") if __name__ == "__main__": app = NameApp() gtk.main() Running the file with python2 yields this error: name.py:9: Warning: cannot create instance of abstract (non-instantiatable) type `GtkBox' builder.add_from_file(filename) ./geany_run_script.sh: line 5: 14897 Segmentation fault python2 "name.py" I thought I followed that example as closely as possible, and I don't see any differences outside of the GTKBuilder file. However, the example in the linked question runs successfully on my machine. I don't know if it's relevant, but I'm running Arch Linux x86_64.

    Read the article

  • Employers and intellectual property 2

    - by Rick
    I have a question about intellectual property, I am currently a manager in a small manufacturing firm. The owners are driven by greed and don't appreciate the development process of complex machinery and are happy just to send things out half done. I on the other hand think that it should be done properly as breakdown in the field can be costly, embarrassing. They seem to have all of us running around doing most of the work out of hours using the attitude of "Be grateful to have a job" yet no one has a contract or any security or any agreement in place. For a couple of the projects i am using PLC's and doing the code in my own time and the testing during company time, and i am aware that they cannot support their own machines if i left, but as i created the code in my own time who owns it? The have asked my to put in a shutdown code for a maintenance request after a given length of time, could this be classed as criminal damage or anything illegal apart from immoral? (we sell the machines with 12 month warrantee, shut down after) But as time goes on I'm getting rather fed up of the companies attitude toward the client. I am considering keeping the clients as my own and get them to contact me directly In the shutdown code. By doing something like this is a trial version contact me for a full license? I wouldn't feel bad for my current employer as he is not afraid to S***t on people as he has been evolved in numerous law suits and has over 30 failed companies leaving people and customers high and dry, we have took the company this far on the reputation of the workers and and i can see things heading like all the other companies he has owned and taking our reputations with him. So i suppose now i have set the scene, if i code into it to contact me directly in the shutdown could there be any legal impact on me, as i rightly or wrongly think i own the code and designs? Cheers R

    Read the article

  • Postfix/Procmail mailing list software

    - by Jason Antman
    I'm looking for suggestions on mailing list software to use on an existing server running Postfix/Procmail. Something relatively simple. requirements: 1 list, < 50 subscribers list members dumped in a certain file by a script (being pulled from LDAP or MySQL on another box) Handles MIME, images, etc. Moderation features No subscription/unsubscription - just goes by the file or database. Mailman is far too heavy-weight, and doesn't seem to play (easily) with Postfix/Procmail. I'm currently using a PHP script that just receives mail as a user, reads a list of members from a serialized array (file dumped on box via cron on the machine with the MySQL database containing members) and re-mails it to everyone. Unfortunately, we now need moderation capabilities, and I don't quite feel like adding that to the PHP script if there's already something out there that does it. Thanks for any tips. -Jason

    Read the article

  • ReSharper C# Live Template for Dependency Property and Property Change Routed Event Boilerplate Code

    - by Bart Read
    I don't know about you but it took me about 5 seconds to get royally fed up of typing the boilerplate code necessary for creating WPF (and Silverlight) dependency properties and, if you want them, their associated property change routed events. Being a ReSharper user, I wondered if there was any live template for doing this. It turns out there's nothing built in, but there are many examples of templates for creating dependency properties out there on the web, such as this excellent one from Roy...(read more)

    Read the article

  • python: how to convert list of lists into a single nested list

    - by Bhuski
    I have a python list of lists as shown below: mylist=[ [['orphan1', ['some value1']]], [['parent1', ['child1', ['child', ['some value2']]]]], [['parent1', ['child2', ['child', ['some value3']]]]] ] I need to convert the above list to some thing like this: result=[ ['orphan1', ['some value1']], ['parent1', ['child1', ['child', ['some value2']]], ['child2', ['child', ['some value3']]]] ] Kindly help me approach this problem. I have given only simple list. In actual scenario here, in my list, even grand parents/grand childs are there. How much ever deep the input nested list is, I need to convert it to a single nested list, with common list elements (parents and grand parents) appearing only once. (but the next to innermost list element('child' in above example) should appear as many times it occurs in the input list. I have been trying to do this last two days, but did not end up with working solution :(. I need to use the output in django template filter: unordered_list so that the resultant nested list appears as a nested unordered list in my html page ..

    Read the article

  • Javascript object list sorting by object property

    - by Constructor
    I need to do this: (sorry not in javascript syntax-still learning object language :) ) object=car attibutes:top-speed, brand.... now I want to sort the list of those cars in order by top-speed, brand... How do I do this (please note the solution must be javascript only, no php or other stuff) ?

    Read the article

  • how protect intellectual property when oursourcing software development?

    - by gkdsp
    I'm a small company needing to outsource software development. I've written both functional and technical specifications for GUI developers and back-end (C or PHP) developers to implement my software application. I'm a little nervous handing over copies of these documents to request bids from numerous companies. Looking for recommendations to protect my work while outsourcing. What's the conventional wisdom? Is there generic NDA someone could send me a link to. How do others handle this situation. What would the outsource companies expect, or not expect, from me?

    Read the article

  • Intellectual-Property Question

    - by Roger J. J.
    Like almost everyone here, I have a handfull of scripts and software that I have developed and am enthused about. I will be looking for my first job as a software designer / coder. It seems natural that I will be eager to please my employer and use scripts or similar methods that I have developed and worked for me in the past to please my employer. It seems certain that many things that I code will look very similar to things I have coded in the past. I don't understand how to document and articulate to an employer that this code base was mine before I got here and this will continue to be mine when I leave. Surely, this is a common issue, but none of the various searches I've done on the net have produced an answer to this question. How is this situation commonly dealt with in the industry? I feel like there should be a digital version of sending myself a 'certified letter' with my code/software/scripts contained. I'm not trying to protect my code from others using it; I am trying to protect my right to continue using my code base that I have developed prior to to gaining employment with an employer.

    Read the article

  • ASA hairpining: I basicaly want to allow 2 spokes to be able to communicate with each other.

    - by Thirst4Knowledge
    ASA Spoke to Spoke Communication I have been looking at spke to spoke comms or "hairpining" for months and have posted on numerouse forums but to no avail. I have a Hub and spoke network where the HUB is an ASA Firewall version 8.2 * I basicaly want to allow 2 spokes to be able to communicate with each other. I think that I have got the concept of the ASA Config for example: same-security-traffic permit intra-interface access-list HQ-LAN extended permit ip ASA-LAN 255.255.248.0 HQ-LAN 255.255.255.0 access-list HQ-LAN extended permit ip 192.168.99.0 255.255.255.0 HQ-LAN 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 HQ-LAN 255.255.255.0 access-list no-nat extended permit ip HQ-LAN 255.255.255.0 192.168.99.0 255.255.255.0 access-list no-nat extended permit ip 192.168.99.0 255.255.255.0 HQ-LAN 255.255.255.0 I think my problem may be that the other spokes are not CIsco Firewalls and I need to work out how to do the alternative setups. I want to at least make sure that my firewall etup is correct then I can move onto the other spokes here is my config: Hostname ASA domain-name mydomain.com names ! interface Ethernet0/0 speed 100 duplex full nameif outside security-level 0 ip address 1.1.1.246 255.255.255.224 ! interface Ethernet0/1 speed 100 duplex full nameif inside security-level 100 ip address 192.168.240.33 255.255.255.224 ! interface Ethernet0/2 description DMZ VLAN-253 speed 100 duplex full nameif DMZ security-level 50 ip address 192.168.254.1 255.255.255.0 ! interface Ethernet0/3 no nameif no security-level no ip address ! boot system disk0:/asa821-k8.bin ftp mode passive clock timezone GMT/BST 0 dns server-group DefaultDNS domain-name mydomain.com same-security-traffic permit inter-interface same-security-traffic permit intra-interface object-group network ASA_LAN_Plus_HQ_LAN network-object ASA_LAN 255.255.248.0 network-object HQ-LAN 255.255.255.0 access-list outside_acl remark Exchange web access-list outside_acl extended permit tcp any host MS-Exchange_server-NAT eq https access-list outside_acl remark PPTP Encapsulation access-list outside_acl extended permit gre any host MS-ISA-Server-NAT access-list outside_acl remark PPTP access-list outside_acl extended permit tcp any host MS-ISA-Server-NAT eq pptp access-list outside_acl remark Intra Http access-list outside_acl extended permit tcp any host MS-ISA-Server-NAT eq www access-list outside_acl remark Intra Https access-list outside_acl extended permit tcp any host MS-ISA-Server-NAT eq https access-list outside_acl remark SSL Server-Https 443 access-list outside_acl remark Https 8443(Open VPN Custom port for SSLVPN client downlaod) access-list outside_acl remark FTP 20 access-list outside_acl remark Http access-list outside_acl extended permit tcp any host OpenVPN-Srvr-NAT object-group DM_INLINE_TCP_1 access-list outside_acl extended permit tcp any host OpenVPN-Srvr-NAT eq 8443 access-list outside_acl extended permit tcp any host OpenVPN-Srvr-NAT eq www access-list outside_acl remark For secure remote Managment-SSH access-list outside_acl extended permit tcp any host OpenVPN-Srvr-NAT eq ssh access-list outside_acl extended permit ip Genimage_Anyconnect 255.255.255.0 ASA_LAN 255.255.248.0 access-list ASP-Live remark Live ASP access-list ASP-Live extended permit ip ASA_LAN 255.255.248.0 192.168.60.0 255.255.255.0 access-list Bo remark Bo access-list Bo extended permit ip ASA_LAN 255.255.248.0 192.168.169.0 255.255.255.0 access-list Bill remark Bill access-list Bill extended permit ip ASA_LAN 255.255.248.0 Bill.15 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 Bill.5 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.149.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.160.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.165.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.144.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.140.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.152.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.153.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.163.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.157.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.167.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.156.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 North-Office-LAN 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.161.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.143.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.137.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.159.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 HQ-LAN 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.169.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.150.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.162.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.166.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.168.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.174.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.127.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.173.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.175.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.176.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.100.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 192.168.99.0 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 10.10.10.0 255.255.255.0 access-list no-nat extended permit ip host 192.168.240.34 Cisco-admin-LAN 255.255.255.0 access-list no-nat extended permit ip ASA_LAN 255.255.248.0 Genimage_Anyconnect 255.255.255.0 access-list no-nat extended permit ip host Tunnel-DC host HQ-SDSL-Peer access-list no-nat extended permit ip HQ-LAN 255.255.255.0 North-Office-LAN 255.255.255.0 access-list no-nat extended permit ip North-Office-LAN 255.255.255.0 HQ-LAN 255.255.255.0 access-list Car remark Car access-list Car extended permit ip ASA_LAN 255.255.248.0 192.168.165.0 255.255.255.0 access-list Che remark Che access-list Che extended permit ip ASA_LAN 255.255.248.0 192.168.144.0 255.255.255.0 access-list Chi remark Chi access-list Chi extended permit ip ASA_LAN 255.255.248.0 192.168.140.0 255.255.255.0 access-list Cla remark Cla access-list Cla extended permit ip ASA_LAN 255.255.248.0 192.168.152.0 255.255.255.0 access-list Eas remark Eas access-list Eas extended permit ip ASA_LAN 255.255.248.0 192.168.149.0 255.255.255.0 access-list Ess remark Ess access-list Ess extended permit ip ASA_LAN 255.255.248.0 192.168.153.0 255.255.255.0 access-list Gat remark Gat access-list Gat extended permit ip ASA_LAN 255.255.248.0 192.168.163.0 255.255.255.0 access-list Hud remark Hud access-list Hud extended permit ip ASA_LAN 255.255.248.0 192.168.157.0 255.255.255.0 access-list Ilk remark Ilk access-list Ilk extended permit ip ASA_LAN 255.255.248.0 192.168.167.0 255.255.255.0 access-list Ken remark Ken access-list Ken extended permit ip ASA_LAN 255.255.248.0 192.168.156.0 255.255.255.0 access-list North-Office remark North-Office access-list North-Office extended permit ip ASA_LAN 255.255.248.0 North-Office-LAN 255.255.255.0 access-list inside_acl remark Inside_ad access-list inside_acl extended permit ip any any access-list Old_HQ remark Old_HQ access-list Old_HQ extended permit ip ASA_LAN 255.255.248.0 HQ-LAN 255.255.255.0 access-list Old_HQ extended permit ip HQ-LAN 255.255.255.0 192.168.99.0 255.255.255.0 access-list She remark She access-list She extended permit ip ASA_LAN 255.255.248.0 192.168.150.0 255.255.255.0 access-list Lit remark Lit access-list Lit extended permit ip ASA_LAN 255.255.248.0 192.168.143.0 255.255.255.0 access-list Mid remark Mid access-list Mid extended permit ip ASA_LAN 255.255.248.0 192.168.137.0 255.255.255.0 access-list Spi remark Spi access-list Spi extended permit ip ASA_LAN 255.255.248.0 192.168.162.0 255.255.255.0 access-list Tor remark Tor access-list Tor extended permit ip ASA_LAN 255.255.248.0 192.168.166.0 255.255.255.0 access-list Tra remark Tra access-list Tra extended permit ip ASA_LAN 255.255.248.0 192.168.168.0 255.255.255.0 access-list Tru remark Tru access-list Tru extended permit ip ASA_LAN 255.255.248.0 192.168.174.0 255.255.255.0 access-list Yo remark Yo access-list Yo extended permit ip ASA_LAN 255.255.248.0 192.168.127.0 255.255.255.0 access-list Nor remark Nor access-list Nor extended permit ip ASA_LAN 255.255.248.0 192.168.159.0 255.255.255.0 access-list Nor extended permit ip ASA_LAN 255.255.248.0 192.168.173.0 255.255.255.0 inactive access-list ST remark ST access-list ST extended permit ip ASA_LAN 255.255.248.0 192.168.175.0 255.255.255.0 access-list Le remark Le access-list Le extended permit ip ASA_LAN 255.255.248.0 192.168.161.0 255.255.255.0 access-list DMZ-ACL remark DMZ access-list DMZ-ACL extended permit ip host OpenVPN-Srvr any access-list no-nat-dmz remark DMZ -No Nat access-list no-nat-dmz extended permit ip 192.168.250.0 255.255.255.0 HQ-LAN 255.255.255.0 access-list Split_Tunnel_List remark ASA-LAN access-list Split_Tunnel_List standard permit ASA_LAN 255.255.248.0 access-list Split_Tunnel_List standard permit Genimage_Anyconnect 255.255.255.0 access-list outside_cryptomap_30 remark Po access-list outside_cryptomap_30 extended permit ip ASA_LAN 255.255.248.0 Po 255.255.255.0 access-list outside_cryptomap_24 extended permit ip ASA_LAN 255.255.248.0 192.168.100.0 255.255.255.0 access-list outside_cryptomap_16 extended permit ip ASA_LAN 255.255.248.0 192.168.99.0 255.255.255.0 access-list outside_cryptomap_34 extended permit ip ASA_LAN 255.255.248.0 10.10.10.0 255.255.255.0 access-list outside_31_cryptomap extended permit ip host 192.168.240.34 Cisco-admin-LAN 255.255.255.0 access-list outside_32_cryptomap extended permit ip host Tunnel-DC host HQ-SDSL-Peer access-list Genimage_VPN_Any_connect_pix_client remark Genimage "Any Connect" VPN access-list Genimage_VPN_Any_connect_pix_client standard permit Genimage_Anyconnect 255.255.255.0 access-list Split-Tunnel-ACL standard permit ASA_LAN 255.255.248.0 access-list nonat extended permit ip HQ-LAN 255.255.255.0 192.168.99.0 255.255.255.0 pager lines 24 logging enable logging timestamp logging console notifications logging monitor notifications logging buffered warnings logging asdm informational no logging message 106015 no logging message 313001 no logging message 313008 no logging message 106023 no logging message 710003 no logging message 106100 no logging message 302015 no logging message 302014 no logging message 302013 no logging message 302018 no logging message 302017 no logging message 302016 no logging message 302021 no logging message 302020 flow-export destination inside MS-ISA-Server 2055 flow-export destination outside 192.168.130.126 2055 flow-export template timeout-rate 1 flow-export delay flow-create 15 mtu outside 1500 mtu inside 1500 mtu DMZ 1500 mtu management 1500 ip local pool RAS-VPN 10.0.0.1.1-10.0.0.1.254 mask 255.255.255.255 icmp unreachable rate-limit 1 burst-size 1 icmp permit any unreachable outside icmp permit any echo outside icmp permit any echo-reply outside icmp permit any outside icmp permit any echo inside icmp permit any echo-reply inside icmp permit any echo DMZ icmp permit any echo-reply DMZ asdm image disk0:/asdm-621.bin no asdm history enable arp timeout 14400 nat-control global (outside) 1 interface global (inside) 1 interface nat (inside) 0 access-list no-nat nat (inside) 1 0.0.0.0 0.0.0.0 nat (DMZ) 0 access-list no-nat-dmz static (inside,outside) MS-ISA-Server-NAT MS-ISA-Server netmask 255.255.255.255 static (DMZ,outside) OpenVPN-Srvr-NAT OpenVPN-Srvr netmask 255.255.255.255 static (inside,outside) MS-Exchange_server-NAT MS-Exchange_server netmask 255.255.255.255 access-group outside_acl in interface outside access-group inside_acl in interface inside access-group DMZ-ACL in interface DMZ route outside 0.0.0.0 0.0.0.0 1.1.1.225 1 route inside 10.10.10.0 255.255.255.0 192.168.240.34 1 route outside Genimage_Anyconnect 255.255.255.0 1.1.1.225 1 route inside Open-VPN 255.255.248.0 OpenVPN-Srvr 1 route inside HQledon-Voice-LAN 255.255.255.0 192.168.240.34 1 route outside Bill 255.255.255.0 1.1.1.225 1 route outside Yo 255.255.255.0 1.1.1.225 1 route inside 192.168.129.0 255.255.255.0 192.168.240.34 1 route outside HQ-LAN 255.255.255.0 1.1.1.225 1 route outside Mid 255.255.255.0 1.1.1.225 1 route outside 192.168.140.0 255.255.255.0 1.1.1.225 1 route outside 192.168.143.0 255.255.255.0 1.1.1.225 1 route outside 192.168.144.0 255.255.255.0 1.1.1.225 1 route outside 192.168.149.0 255.255.255.0 1.1.1.225 1 route outside 192.168.152.0 255.255.255.0 1.1.1.225 1 route outside 192.168.153.0 255.255.255.0 1.1.1.225 1 route outside North-Office-LAN 255.255.255.0 1.1.1.225 1 route outside 192.168.156.0 255.255.255.0 1.1.1.225 1 route outside 192.168.157.0 255.255.255.0 1.1.1.225 1 route outside 192.168.159.0 255.255.255.0 1.1.1.225 1 route outside 192.168.160.0 255.255.255.0 1.1.1.225 1 route outside 192.168.161.0 255.255.255.0 1.1.1.225 1 route outside 192.168.162.0 255.255.255.0 1.1.1.225 1 route outside 192.168.163.0 255.255.255.0 1.1.1.225 1 route outside 192.168.165.0 255.255.255.0 1.1.1.225 1 route outside 192.168.166.0 255.255.255.0 1.1.1.225 1 route outside 192.168.167.0 255.255.255.0 1.1.1.225 1 route outside 192.168.168.0 255.255.255.0 1.1.1.225 1 route outside 192.168.173.0 255.255.255.0 1.1.1.225 1 route outside 192.168.174.0 255.255.255.0 1.1.1.225 1 route outside 192.168.175.0 255.255.255.0 1.1.1.225 1 route outside 192.168.99.0 255.255.255.0 1.1.1.225 1 route inside ASA_LAN 255.255.255.0 192.168.240.34 1 route inside 192.168.124.0 255.255.255.0 192.168.240.34 1 route inside 192.168.50.0 255.255.255.0 192.168.240.34 1 route inside 192.168.51.0 255.255.255.128 192.168.240.34 1 route inside 192.168.240.0 255.255.255.224 192.168.240.34 1 route inside 192.168.240.164 255.255.255.224 192.168.240.34 1 route inside 192.168.240.196 255.255.255.224 192.168.240.34 1 timeout xlate 3:00:00 timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02 timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00 timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00 timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute timeout tcp-proxy-reassembly 0:01:00 dynamic-access-policy-record DfltAccessPolicy aaa-server vpn protocol radius max-failed-attempts 5 aaa-server vpn (inside) host 192.168.X.2 timeout 60 key a5a53r3t authentication-port 1812 radius-common-pw a5a53r3t aaa authentication ssh console LOCAL aaa authentication http console LOCAL http server enable http 0.0.0.0 0.0.0.0 inside http 1.1.1.2 255.255.255.255 outside http 1.1.1.234 255.255.255.255 outside http 0.0.0.0 0.0.0.0 management http 1.1.100.198 255.255.255.255 outside http 0.0.0.0 0.0.0.0 outside crypto map FW_Outside_map 1 match address Bill crypto map FW_Outside_map 1 set peer x.x.x.121 crypto map FW_Outside_map 1 set transform-set SECURE crypto map FW_Outside_map 2 match address Bo crypto map FW_Outside_map 2 set peer x.x.x.202 crypto map FW_Outside_map 2 set transform-set SECURE crypto map FW_Outside_map 3 match address ASP-Live crypto map FW_Outside_map 3 set peer x.x.x.113 crypto map FW_Outside_map 3 set transform-set SECURE crypto map FW_Outside_map 4 match address Car crypto map FW_Outside_map 4 set peer x.x.x.205 crypto map FW_Outside_map 4 set transform-set SECURE crypto map FW_Outside_map 5 match address Old_HQ crypto map FW_Outside_map 5 set peer x.x.x.2 crypto map FW_Outside_map 5 set transform-set SECURE WG crypto map FW_Outside_map 6 match address Che crypto map FW_Outside_map 6 set peer x.x.x.204 crypto map FW_Outside_map 6 set transform-set SECURE crypto map FW_Outside_map 7 match address Chi crypto map FW_Outside_map 7 set peer x.x.x.212 crypto map FW_Outside_map 7 set transform-set SECURE crypto map FW_Outside_map 8 match address Cla crypto map FW_Outside_map 8 set peer x.x.x.215 crypto map FW_Outside_map 8 set transform-set SECURE crypto map FW_Outside_map 9 match address Eas crypto map FW_Outside_map 9 set peer x.x.x.247 crypto map FW_Outside_map 9 set transform-set SECURE crypto map FW_Outside_map 10 match address Ess crypto map FW_Outside_map 10 set peer x.x.x.170 crypto map FW_Outside_map 10 set transform-set SECURE crypto map FW_Outside_map 11 match address Hud crypto map FW_Outside_map 11 set peer x.x.x.8 crypto map FW_Outside_map 11 set transform-set SECURE crypto map FW_Outside_map 12 match address Gat crypto map FW_Outside_map 12 set peer x.x.x.212 crypto map FW_Outside_map 12 set transform-set SECURE crypto map FW_Outside_map 13 match address Ken crypto map FW_Outside_map 13 set peer x.x.x.230 crypto map FW_Outside_map 13 set transform-set SECURE crypto map FW_Outside_map 14 match address She crypto map FW_Outside_map 14 set peer x.x.x.24 crypto map FW_Outside_map 14 set transform-set SECURE crypto map FW_Outside_map 15 match address North-Office crypto map FW_Outside_map 15 set peer x.x.x.94 crypto map FW_Outside_map 15 set transform-set SECURE crypto map FW_Outside_map 16 match address outside_cryptomap_16 crypto map FW_Outside_map 16 set peer x.x.x.134 crypto map FW_Outside_map 16 set transform-set SECURE crypto map FW_Outside_map 16 set security-association lifetime seconds crypto map FW_Outside_map 17 match address Lit crypto map FW_Outside_map 17 set peer x.x.x.110 crypto map FW_Outside_map 17 set transform-set SECURE crypto map FW_Outside_map 18 match address Mid crypto map FW_Outside_map 18 set peer 78.x.x.110 crypto map FW_Outside_map 18 set transform-set SECURE crypto map FW_Outside_map 19 match address Sp crypto map FW_Outside_map 19 set peer x.x.x.47 crypto map FW_Outside_map 19 set transform-set SECURE crypto map FW_Outside_map 20 match address Tor crypto map FW_Outside_map 20 set peer x.x.x.184 crypto map FW_Outside_map 20 set transform-set SECURE crypto map FW_Outside_map 21 match address Tr crypto map FW_Outside_map 21 set peer x.x.x.75 crypto map FW_Outside_map 21 set transform-set SECURE crypto map FW_Outside_map 22 match address Yo crypto map FW_Outside_map 22 set peer x.x.x.40 crypto map FW_Outside_map 22 set transform-set SECURE crypto map FW_Outside_map 23 match address Tra crypto map FW_Outside_map 23 set peer x.x.x.145 crypto map FW_Outside_map 23 set transform-set SECURE crypto map FW_Outside_map 24 match address outside_cryptomap_24 crypto map FW_Outside_map 24 set peer x.x.x.46 crypto map FW_Outside_map 24 set transform-set SECURE crypto map FW_Outside_map 24 set security-association lifetime seconds crypto map FW_Outside_map 25 match address Nor crypto map FW_Outside_map 25 set peer x.x.x.70 crypto map FW_Outside_map 25 set transform-set SECURE crypto map FW_Outside_map 26 match address Ilk crypto map FW_Outside_map 26 set peer x.x.x.65 crypto map FW_Outside_map 26 set transform-set SECURE crypto map FW_Outside_map 27 match address Nor crypto map FW_Outside_map 27 set peer x.x.x.240 crypto map FW_Outside_map 27 set transform-set SECURE crypto map FW_Outside_map 28 match address ST crypto map FW_Outside_map 28 set peer x.x.x.163 crypto map FW_Outside_map 28 set transform-set SECURE crypto map FW_Outside_map 28 set security-association lifetime seconds crypto map FW_Outside_map 28 set security-association lifetime kilobytes crypto map FW_Outside_map 29 match address Lei crypto map FW_Outside_map 29 set peer x.x.x.4 crypto map FW_Outside_map 29 set transform-set SECURE crypto map FW_Outside_map 30 match address outside_cryptomap_30 crypto map FW_Outside_map 30 set peer x.x.x.34 crypto map FW_Outside_map 30 set transform-set SECURE crypto map FW_Outside_map 31 match address outside_31_cryptomap crypto map FW_Outside_map 31 set pfs crypto map FW_Outside_map 31 set peer Cisco-admin-Peer crypto map FW_Outside_map 31 set transform-set ESP-AES-256-SHA crypto map FW_Outside_map 32 match address outside_32_cryptomap crypto map FW_Outside_map 32 set pfs crypto map FW_Outside_map 32 set peer HQ-SDSL-Peer crypto map FW_Outside_map 32 set transform-set ESP-AES-256-SHA crypto map FW_Outside_map 34 match address outside_cryptomap_34 crypto map FW_Outside_map 34 set peer x.x.x.246 crypto map FW_Outside_map 34 set transform-set ESP-AES-128-SHA ESP-AES-192-SHA ESP-AES-256-SHA crypto map FW_Outside_map 65535 ipsec-isakmp dynamic dynmap crypto map FW_Outside_map interface outside crypto map FW_outside_map 31 set peer x.x.x.45 crypto isakmp identity address crypto isakmp enable outside crypto isakmp policy 9 webvpn enable outside svc enable group-policy ASA-LAN-VPN internal group-policy ASA_LAN-VPN attributes wins-server value 192.168.x.1 192.168.x.2 dns-server value 192.168.x.1 192.168.x.2 vpn-tunnel-protocol IPSec svc split-tunnel-policy tunnelspecified split-tunnel-network-list value Split-Tunnel-ACL default-domain value MYdomain username xxxxxxxxxx password privilege 15 tunnel-group DefaultRAGroup ipsec-attributes isakmp keepalive threshold 30 retry 2 tunnel-group DefaultWEBVPNGroup ipsec-attributes isakmp keepalive threshold 30 retry 2 tunnel-group x.x.x.121 type ipsec-l2l tunnel-group x.x.x..121 ipsec-attributes pre-shared-key * isakmp keepalive threshold 30 retry 2 tunnel-group x.x.x.202 type ipsec-l2l tunnel-group x.x.x.202 ipsec-attributes pre-shared-key * isakmp keepalive threshold 30 retry 2 tunnel-group x.x.x.113 type ipsec-l2l tunnel-group x.x.x.113 ipsec-attributes pre-shared-key * isakmp keepalive threshold 30 retry 2 tunnel-group x.x.x.205 type ipsec-l2l tunnel-group x.x.x.205 ipsec-attributes pre-shared-key * isakmp keepalive threshold 30 retry 2 tunnel-group x.x.x.204 type ipsec-l2l tunnel-group x.x.x.204 ipsec-attributes pre-shared-key * isakmp keepalive threshold 30 retry 2 tunnel-group x.x.x.212 type ipsec-l2l tunnel-group x.x.x.212 ipsec-attributes pre-shared-key * tunnel-group x.x.x.215 type ipsec-l2l tunnel-group x.x.x.215 ipsec-attributes pre-shared-key * tunnel-group x.x.x.247 type ipsec-l2l tunnel-group x.x.x.247 ipsec-attributes pre-shared-key * tunnel-group x.x.x.170 type ipsec-l2l tunnel-group x.x.x.170 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group x.x.x..8 type ipsec-l2l tunnel-group x.x.x.8 ipsec-attributes pre-shared-key * tunnel-group x.x.x.212 type ipsec-l2l tunnel-group x.x.x.212 ipsec-attributes pre-shared-key * tunnel-group x.x.x.230 type ipsec-l2l tunnel-group x.x.x.230 ipsec-attributes pre-shared-key * tunnel-group x.x.x.24 type ipsec-l2l tunnel-group x.x.x.24 ipsec-attributes pre-shared-key * tunnel-group x.x.x.46 type ipsec-l2l tunnel-group x.x.x.46 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group x.x.x.4 type ipsec-l2l tunnel-group x.x.x.4 ipsec-attributes pre-shared-key * tunnel-group x.x.x.110 type ipsec-l2l tunnel-group x.x.x.110 ipsec-attributes pre-shared-key * tunnel-group 78.x.x.110 type ipsec-l2l tunnel-group 78.x.x.110 ipsec-attributes pre-shared-key * tunnel-group x.x.x.47 type ipsec-l2l tunnel-group x.x.x.47 ipsec-attributes pre-shared-key * tunnel-group x.x.x.34 type ipsec-l2l tunnel-group x.x.x.34 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group x.x.x..129 type ipsec-l2l tunnel-group x.x.x.129 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group x.x.x.94 type ipsec-l2l tunnel-group x.x.x.94 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group x.x.x.40 type ipsec-l2l tunnel-group x.x.x.40 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group x.x.x.65 type ipsec-l2l tunnel-group x.x.x.65 ipsec-attributes pre-shared-key * tunnel-group x.x.x.70 type ipsec-l2l tunnel-group x.x.x.70 ipsec-attributes pre-shared-key * tunnel-group x.x.x.134 type ipsec-l2l tunnel-group x.x.x.134 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group x.x.x.163 type ipsec-l2l tunnel-group x.x.x.163 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group x.x.x.2 type ipsec-l2l tunnel-group x.x.x.2 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group ASA-LAN-VPN type remote-access tunnel-group ASA-LAN-VPN general-attributes address-pool RAS-VPN authentication-server-group vpn authentication-server-group (outside) vpn default-group-policy ASA-LAN-VPN tunnel-group ASA-LAN-VPN ipsec-attributes pre-shared-key * tunnel-group x.x.x.184 type ipsec-l2l tunnel-group x.x.x.184 ipsec-attributes pre-shared-key * tunnel-group x.x.x.145 type ipsec-l2l tunnel-group x.x.x.145 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group x.x.x.75 type ipsec-l2l tunnel-group x.x.x.75 ipsec-attributes pre-shared-key * tunnel-group x.x.x.246 type ipsec-l2l tunnel-group x.x.x.246 ipsec-attributes pre-shared-key * isakmp keepalive disable tunnel-group x.x.x.2 type ipsec-l2l tunnel-group x.x.x..2 ipsec-attributes pre-shared-key * tunnel-group x.x.x.98 type ipsec-l2l tunnel-group x.x.x.98 ipsec-attributes pre-shared-key * ! ! ! policy-map global_policy description Netflow class class-default flow-export event-type all destination MS-ISA-Server policy-map type inspect dns migrated_dns_map_1 parameters message-length maximum 512 Anyone have a clue because Im on the verge of going postal.....

    Read the article

  • Prolog adding and removing list element if non present in second list

    - by logically
    I don't know what I'm missing here. I wan't to add an element if it is in arg1 but not in arg2 and want to remove an element if it is in arg1 but not in arg2. I'm using an if condition with includes function that return true if the element is in the arg2 list, false otherwise. Then use built it predicates append and select to add or remove. I'm getting false to all my objectives searches. I comment and uncomment depending on what predicate I want, add or remove. includes([],_). includes([P|Z],S) :- memberchk(P,S), includes(Z,S). addop([],list,res). addop([P|R],list,res) :- includes(P,s0) - addop(R,list,res) ; append(P,list,res), addop(R,list,res). rem([],list,res). rem([P|R],list,res) :- includes(P,list) - rem(R,list,res) ; select(P,list,res),rem(R,list,res). Thanks for help.

    Read the article

  • Demystifying Silverlight Dependency Properties

    - by dwahlin
    I have the opportunity to teach a lot of people about Silverlight (amongst other technologies) and one of the topics that definitely confuses people initially is the concept of dependency properties. I confess that when I first heard about them my initial thought was “Why do we need a specialized type of property?” While you can certainly use standard CLR properties in Silverlight applications, Silverlight relies heavily on dependency properties for just about everything it does behind the scenes. In fact, dependency properties are an essential part of the data binding, template, style and animation functionality available in Silverlight. They simply back standard CLR properties. In this post I wanted to put together a (hopefully) simple explanation of dependency properties and why you should care about them if you’re currently working with Silverlight or looking to move to it.   What are Dependency Properties? XAML provides a great way to define layout controls, user input controls, shapes, colors and data binding expressions in a declarative manner. There’s a lot that goes on behind the scenes in order to make XAML work and an important part of that magic is the use of dependency properties. If you want to bind data to a property, style it, animate it or transform it in XAML then the property involved has to be a dependency property to work properly. If you’ve ever positioned a control in a Canvas using Canvas.Left or placed a control in a specific Grid row using Grid.Row then you’ve used an attached property which is a specialized type of dependency property. Dependency properties play a key role in XAML and the overall Silverlight framework. Any property that you bind, style, template, animate or transform must be a dependency property in Silverlight applications. You can programmatically bind values to controls and work with standard CLR properties, but if you want to use the built-in binding expressions available in XAML (one of my favorite features) or the Binding class available through code then dependency properties are a necessity. Dependency properties aren’t needed in every situation, but if you want to customize your application very much you’ll eventually end up needing them. For example, if you create a custom user control and want to expose a property that consumers can use to change the background color, you have to define it as a dependency property if you want bindings, styles and other features to be available for use. Now that the overall purpose of dependency properties has been discussed let’s take a look at how you can create them. Creating Dependency Properties When .NET first came out you had to write backing fields for each property that you defined as shown next: Brush _ScheduleBackground; public Brush ScheduleBackground { get { return _ScheduleBackground; } set { _ScheduleBackground = value; } } Although .NET 2.0 added auto-implemented properties (for example: public Brush ScheduleBackground { get; set; }) where the compiler would automatically generate the backing field used by get and set blocks, the concept is still the same as shown in the above code; a property acts as a wrapper around a field. Silverlight dependency properties replace the _ScheduleBackground field shown in the previous code and act as the backing store for a standard CLR property. The following code shows an example of defining a dependency property named ScheduleBackgroundProperty: public static readonly DependencyProperty ScheduleBackgroundProperty = DependencyProperty.Register("ScheduleBackground", typeof(Brush), typeof(Scheduler), null);   Looking through the code the first thing that may stand out is that the definition for ScheduleBackgroundProperty is marked as static and readonly and that the property appears to be of type DependencyProperty. This is a standard pattern that you’ll use when working with dependency properties. You’ll also notice that the property explicitly adds the word “Property” to the name which is another standard you’ll see followed. In addition to defining the property, the code also makes a call to the static DependencyProperty.Register method and passes the name of the property to register (ScheduleBackground in this case) as a string. The type of the property, the type of the class that owns the property and a null value (more on the null value later) are also passed. In this example a class named Scheduler acts as the owner. The code handles registering the property as a dependency property with the call to Register(), but there’s a little more work that has to be done to allow a value to be assigned to and retrieved from the dependency property. The following code shows the complete code that you’ll typically use when creating a dependency property. You can find code snippets that greatly simplify the process of creating dependency properties out on the web. The MVVM Light download available from http://mvvmlight.codeplex.com comes with built-in dependency properties snippets as well. public static readonly DependencyProperty ScheduleBackgroundProperty = DependencyProperty.Register("ScheduleBackground", typeof(Brush), typeof(Scheduler), null); public Brush ScheduleBackground { get { return (Brush)GetValue(ScheduleBackgroundProperty); } set { SetValue(ScheduleBackgroundProperty, value); } } The standard CLR property code shown above should look familiar since it simply wraps the dependency property. However, you’ll notice that the get and set blocks call GetValue and SetValue methods respectively to perform the appropriate operation on the dependency property. GetValue and SetValue are members of the DependencyObject class which is another key component of the Silverlight framework. Silverlight controls and classes (TextBox, UserControl, CompositeTransform, DataGrid, etc.) ultimately derive from DependencyObject in their inheritance hierarchy so that they can support dependency properties. Dependency properties defined in Silverlight controls and other classes tend to follow the pattern of registering the property by calling Register() and then wrapping the dependency property in a standard CLR property (as shown above). They have a standard property that wraps a registered dependency property and allows a value to be assigned and retrieved. If you need to expose a new property on a custom control that supports data binding expressions in XAML then you’ll follow this same pattern. Dependency properties are extremely useful once you understand why they’re needed and how they’re defined. Detecting Changes and Setting Defaults When working with dependency properties there will be times when you want to assign a default value or detect when a property changes so that you can keep the user interface in-sync with the property value. Silverlight’s DependencyProperty.Register() method provides a fourth parameter that accepts a PropertyMetadata object instance. PropertyMetadata can be used to hook a callback method to a dependency property. The callback method is called when the property value changes. PropertyMetadata can also be used to assign a default value to the dependency property. By assigning a value of null for the final parameter passed to Register() you’re telling the property that you don’t care about any changes and don’t have a default value to apply. Here are the different constructor overloads available on the PropertyMetadata class: PropertyMetadata Constructor Overload Description PropertyMetadata(Object) Used to assign a default value to a dependency property. PropertyMetadata(PropertyChangedCallback) Used to assign a property changed callback method. PropertyMetadata(Object, PropertyChangedCalback) Used to assign a default property value and a property changed callback.   There are many situations where you need to know when a dependency property changes or where you want to apply a default. Performing either task is easily accomplished by creating a new instance of the PropertyMetadata class and passing the appropriate values to its constructor. The following code shows an enhanced version of the initial dependency property code shown earlier that demonstrates these concepts: public Brush ScheduleBackground { get { return (Brush)GetValue(ScheduleBackgroundProperty); } set { SetValue(ScheduleBackgroundProperty, value); } } public static readonly DependencyProperty ScheduleBackgroundProperty = DependencyProperty.Register("ScheduleBackground", typeof(Brush), typeof(Scheduler), new PropertyMetadata(new SolidColorBrush(Colors.LightGray), ScheduleBackgroundChanged)); private static void ScheduleBackgroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var scheduler = d as Scheduler; scheduler.Background = e.NewValue as Brush; } The code wires ScheduleBackgroundProperty to a property change callback method named ScheduleBackgroundChanged. What’s interesting is that this callback method is static (as is the dependency property) so it gets passed the instance of the object that owns the property that has changed (otherwise we wouldn’t be able to get to the object instance). In this example the dependency object is cast to a Scheduler object and its Background property is assigned to the new value of the dependency property. The code also handles assigning a default value of LightGray to the dependency property by creating a new instance of a SolidColorBrush. To Sum Up In this post you’ve seen the role of dependency properties and how they can be defined in code. They play a big role in XAML and the overall Silverlight framework. You can think of dependency properties as being replacements for fields that you’d normally use with standard CLR properties. In addition to a discussion on how dependency properties are created, you also saw how to use the PropertyMetadata class to define default dependency property values and hook a dependency property to a callback method. The most important thing to understand with dependency properties (especially if you’re new to Silverlight) is that they’re needed if you want a property to support data binding, animations, transformations and styles properly. Any time you create a property on a custom control or user control that has these types of requirements you’ll want to pick a dependency property over of a standard CLR property with a backing field. There’s more that can be covered with dependency properties including a related property called an attached property….more to come.

    Read the article

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