Search Results

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

Page 50/433 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • "no block given" errors with cache_money

    - by emh
    i've inherited a site that in production is generating dozens of "no block given" exceptions every 5 minutes. the top of the stack trace is: vendor/gems/nkallen-cache-money-0.2.5/lib/cash/accessor.rb:42:in `add' vendor/gems/nkallen-cache-money-0.2.5/lib/cash/accessor.rb:33:in `get' vendor/gems/nkallen-cache-money-0.2.5/lib/cash/accessor.rb:22:in `call' vendor/gems/nkallen-cache-money-0.2.5/lib/cash/accessor.rb:22:in `fetch' vendor/gems/nkallen-cache-money-0.2.5/lib/cash/accessor.rb:31:in `get' so it appears that the problem is in the cache money plugin. has anyone experienced something similar? i've cut and pasted the relevant code below -- anyone more familiar with blocks able to discern any obvious problems? 11 def fetch(keys, options = {}, &block) 12 case keys 13 when Array 14 keys = keys.collect { |key| cache_key(key) } 15 hits = repository.get_multi(keys) 16 if (missed_keys = keys - hits.keys).any? 17 missed_values = block.call(missed_keys) 18 hits.merge!(missed_keys.zip(Array(missed_values)).to_hash) 19 end 20 hits 21 else 22 repository.get(cache_key(keys), options[:raw]) || (block ? block.call : nil) 23 end 24 end 25 26 def get(keys, options = {}, &block) 27 case keys 28 when Array 29 fetch(keys, options, &block) 30 else 31 fetch(keys, options) do 32 if block_given? 33 add(keys, result = yield(keys), options) 34 result 35 end 36 end 37 end 38 end 39 40 def add(key, value, options = {}) 41 if repository.add(cache_key(key), value, options[:ttl] || 0, options[:raw]) == "NOT_STORED\r\n" 42 yield 43 end 44 end

    Read the article

  • How to retrieve all keys (or values) from a std::map?

    - by Owen
    This is one of the possible ways I come out: struct RetrieveKey { template <typename T> typename T::first_type operator()(T keyValuePair) const { return keyValuePair.first; } }; map<int, int> m; vector<int> keys; // Retrieve all keys transform(m.begin(), m.end(), back_inserter(keys), RetrieveKey()); // Dump all keys copy(keys.begin(), keys.end(), ostream_iterator<int>(cout, "\n")); Of course, we can also retrieve all values from the map by defining another functor RetrieveValues. Is there any other way to achieve this easily? (I'm always wondering why std::map does not include a member function for us to do so.)

    Read the article

  • MySQL Cluster 7.3 Labs Release – Foreign Keys Are In!

    - by Mat Keep
    0 0 1 1097 6254 Homework 52 14 7337 14.0 Normal 0 false false false EN-US JA X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:Cambria; mso-ascii-font-family:Cambria; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Cambria; mso-hansi-theme-font:minor-latin; mso-ansi-language:EN-US;} Summary (aka TL/DR): Support for Foreign Key constraints has been one of the most requested feature enhancements for MySQL Cluster. We are therefore extremely excited to announce that Foreign Keys are part of the first Labs Release of MySQL Cluster 7.3 – available for download, evaluation and feedback now! (Select the mysql-cluster-7.3-labs-June-2012 build) In this blog, I will attempt to discuss the design rationale, implementation, configuration and steps to get started in evaluating the first MySQL Cluster 7.3 Labs Release. Pace of Innovation It was only a couple of months ago that we announced the General Availability (GA) of MySQL Cluster 7.2, delivering 1 billion Queries per Minute, with 70x higher cross-shard JOIN performance, Memcached NoSQL key-value API and cross-data center replication.  This release has been a huge hit, with downloads and deployments quickly reaching record levels. The announcement of the first MySQL Cluster 7.3 Early Access lab release at today's MySQL Innovation Day event demonstrates the continued pace in Cluster development, and provides an opportunity for the community to evaluate and feedback on new features they want to see. What’s the Plan for MySQL Cluster 7.3? Well, Foreign Keys, as you may have gathered by now (!), and this is the focus of this first Labs Release. As with MySQL Cluster 7.2, we plan to publish a series of preview releases for 7.3 that will incrementally add new candidate features for a final GA release (subject to usual safe harbor statement below*), including: - New NoSQL APIs; - Features to automate the configuration and provisioning of multi-node clusters, on premise or in the cloud; - Performance and scalability enhancements; - Taking advantage of features in the latest MySQL 5.x Server GA. Design Rationale MySQL Cluster is designed as a “Not-Only-SQL” database. It combines attributes that enable users to blend the best of both relational and NoSQL technologies into solutions that deliver web scalability with 99.999% availability and real-time performance, including: Concurrent NoSQL and SQL access to the database; Auto-sharding with simple scale-out across commodity hardware; Multi-master replication with failover and recovery both within and across data centers; Shared-nothing architecture with no single point of failure; Online scaling and schema changes; ACID compliance and support for complex queries, across shards. Native support for Foreign Key constraints enables users to extend the benefits of MySQL Cluster into a broader range of use-cases, including: - Packaged applications in areas such as eCommerce and Web Content Management that prescribe databases with Foreign Key support. - In-house developments benefiting from Foreign Key constraints to simplify data models and eliminate the additional application logic needed to maintain data consistency and integrity between tables. Implementation The Foreign Key functionality is implemented directly within MySQL Cluster’s data nodes, allowing any client API accessing the cluster to benefit from them – whether using SQL or one of the NoSQL interfaces (Memcached, C++, Java, JPA or HTTP/REST.) The core referential actions defined in the SQL:2003 standard are implemented: CASCADE RESTRICT NO ACTION SET NULL In addition, the MySQL Cluster implementation supports the online adding and dropping of Foreign Keys, ensuring the Cluster continues to serve both read and write requests during the operation. An important difference to note with the Foreign Key implementation in InnoDB is that MySQL Cluster does not support the updating of Primary Keys from within the Data Nodes themselves - instead the UPDATE is emulated with a DELETE followed by an INSERT operation. Therefore an UPDATE operation will return an error if the parent reference is using a Primary Key, unless using CASCADE action, in which case the delete operation will result in the corresponding rows in the child table being deleted. The Engineering team plans to change this behavior in a subsequent preview release. Also note that when using InnoDB "NO ACTION" is identical to "RESTRICT". In the case of MySQL Cluster “NO ACTION” means “deferred check”, i.e. the constraint is checked before commit, allowing user-defined triggers to automatically make changes in order to satisfy the Foreign Key constraints. Configuration There is nothing special you have to do here – Foreign Key constraint checking is enabled by default. If you intend to migrate existing tables from another database or storage engine, for example from InnoDB, there are a couple of best practices to observe: 1. Analyze the structure of the Foreign Key graph and run the ALTER TABLE ENGINE=NDB in the correct sequence to ensure constraints are enforced 2. Alternatively drop the Foreign Key constraints prior to the import process and then recreate when complete. Getting Started Read this blog for a demonstration of using Foreign Keys with MySQL Cluster.  You can download MySQL Cluster 7.3 Labs Release with Foreign Keys today - (select the mysql-cluster-7.3-labs-June-2012 build) If you are new to MySQL Cluster, the Getting Started guide will walk you through installing an evaluation cluster on a singe host (these guides reflect MySQL Cluster 7.2, but apply equally well to 7.3) Post any questions to the MySQL Cluster forum where our Engineering team will attempt to assist you. Post any bugs you find to the MySQL bug tracking system (select MySQL Cluster from the Category drop-down menu) And if you have any feedback, please post them to the Comments section of this blog. Summary MySQL Cluster 7.2 is the GA, production-ready release of MySQL Cluster. This first Labs Release of MySQL Cluster 7.3 gives you the opportunity to preview and evaluate future developments in the MySQL Cluster database, and we are very excited to be able to share that with you. Let us know how you get along with MySQL Cluster 7.3, and other features that you want to see in future releases. * Safe Harbor Statement This information is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

    Read the article

  • How do I make the F-keys work in byobu on 12.04, for midnight commander (mc), htop, etc?

    - by Jorge Castro
    I use byobu with the tmux backend on my 12.04 server. I'd like to use the midnight commander shortcut keys with it, but the F keys don't work. I've seen some posts on the issues here: https://bugs.launchpad.net/byobu/+bug/386363 https://answers.launchpad.net/byobu/+question/127610 but they are out of date and don't seem to work for newer versions of byobu. How can I either work around this or use MC in a way that works better?

    Read the article

  • Script to create or drop all primary keys now on TechNet Wiki.

    - by John Paul Cook
    I posted my script to create or drop all primary keys on the TechNet Wiki. You can find it at http://social.technet.microsoft.com/wiki/contents/articles/script-to-create-or-drop-all-primary-keys.aspx . I first published the script here in 2009 and I've always wanted a way for the community to enhance it or correct it. The TechNet Wiki makes that possible. Visit the Wiki and see if you like this approach to publishing scripts....(read more)

    Read the article

  • New HandleProcessCorruptedStateExceptions attribute in .Net 4

    - by Yaakov Davis
    I'm trying to crash my WPF application, and capture the exception using the above new .Net 4 attribute. I managed to manually crash my application by calling Environment.FailFast("crash");. (Also managed to crash it using Hans's code from here: http://stackoverflow.com/questions/2950130/how-to-simulate-a-corrupt-state-exception-in-net-4). The app calls the above crashing code when pressing on a button. Here are my exception handlers: protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; DispatcherUnhandledException += app_DispatcherUnhandledException; } [HandleProcessCorruptedStateExceptions] void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { //log.. } [HandleProcessCorruptedStateExceptions] void CurrentDomain_FirstChanceException(object sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e) { //log.. } [HandleProcessCorruptedStateExceptions] void app_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { //log.. } The //log... comment shown above is just for illustration; there's real logging code there. When running in VS, an exception is thrown, but it doesn't 'bubble' up to those exception handler blocks. When running as standalone (w/o debugger attached), I don't get any log, despite what I expect. Does anyone has an idea why is it so, and how to make the handling code to be executed? Many thanks, Yaakov

    Read the article

  • Silverlight MergedDictionary - Attribute Value out of Range

    - by Wonko the Sane
    Hello All, I have a Silverlight-3 solution that contains a few different projects. I want to have one "common" project for holding controls and resources that will be used by multiple other projects. Within the common project, there is a folder called Resources, which holds a ResourceDictionary (CommonColors.xaml). This is set to be built as a Resource, Do Not Copy. I add a reference to the common project in another project (call it UncommonControls), and attempt to add the ResourceDictionary as a MergedDictionary: <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/Common;component/Resources/CommonColors.xaml" /> <ResourceDictionary Source="/UncommonControls;component/Resources/UncommonStyles.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </UserControl.Resources> When I try to run, I get an exception: Attribute /Common;component/Resources/CommonColors.xaml value is out of range. [Line: 14 Position: 44] --- Inner Exception --- The given key was not present in the dictionary. However, if I reference a ResourceDictionary local to Uncommon (such as the UncommonStyles.xaml, above) project, which is set up with the same Build properties, it works fine. I haven't seen anything that says SL3 can't reference an external ResourceDictionary (on the contrary, I've seen an example of using one, albeit with no downloadable project to verify the behavior). Thanks, Wonko

    Read the article

  • .NET 4 RTM MetadataType attribute ignored when using Validator

    - by bart
    I am using VS 2010 RTM and trying to perform some basic validation on a simple type using MetadataTypeAttribute. When I put the validation attribute on the main class, everything works. However, when I put it on the metadata class, it seems to be ignored. I must be missing something trivial, but I've been stuck on this for a while now. I had a look at the Enterprise Library validation block as a workaround, but it doesn't support validation of single properties out of the box. Any ideas? class Program { static void Main(string[] args) { Stuff t = new Stuff(); try { Validator.ValidateProperty(t.X, new ValidationContext(t, null, null) { MemberName = "X" }); Console.WriteLine("Failed!"); } catch (ValidationException) { Console.WriteLine("Succeeded!"); } } } [MetadataType(typeof(StuffMetadata))] public class Stuff { //[Required] //works here public string X { get; set; } } public class StuffMetadata { [Required] //no effect here public string X { get; set; } }

    Read the article

  • Django Error - AttributeError: 'Settings' object has no attribute 'LOCALE_PATHS'

    - by Randy Simon
    I am trying to learn django by following along with this tutorial. I am using django version 1.1.1 I run django-admin.py startproject mysite and it creates the files it should. Then I try to start the server by running python manage.py runserver but here is where I get the following error. Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 362, in execute_manager utility.execute() File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 303, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv self.execute(*args, **options.__dict__) File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 213, in execute translation.activate('en-us') File "/Library/Python/2.6/site-packages/django/utils/translation/__init__.py", line 73, in activate return real_activate(language) File "/Library/Python/2.6/site-packages/django/utils/translation/__init__.py", line 43, in delayed_loader return g['real_%s' % caller](*args, **kwargs) File "/Library/Python/2.6/site-packages/django/utils/translation/trans_real.py", line 205, in activate _active[currentThread()] = translation(language) File "/Library/Python/2.6/site-packages/django/utils/translation/trans_real.py", line 194, in translation default_translation = _fetch(settings.LANGUAGE_CODE) File "/Library/Python/2.6/site-packages/django/utils/translation/trans_real.py", line 172, in _fetch for localepath in settings.LOCALE_PATHS: File "/Library/Python/2.6/site-packages/django/utils/functional.py", line 273, in __getattr__ return getattr(self._wrapped, name) AttributeError: 'Settings' object has no attribute 'LOCALE_PATHS' Now, I can add a LOCAL_PATH atribute set to an empty string to my settings.py file but then it just complains about another setting and so on. What am I missing here?

    Read the article

  • Parse a xml attribute depending on child content

    - by eddiefernberg
    Hello! I load an external xml file containing user metas looking like this: <?xml version="1.0" encoding="utf-8"?> <user_information> <user url="http://usersweb.com"> <name>Arnold</name> <lastname> <name>Arnoldson</name> </lastname> <age>42</age> </user> <user url="http://anotheruserweb.com"> <name>Arnold</name> <lastname> <name>Arichson</name> </lastname> <age>42</age> </user> And so on.... </user_information> I know the formatting with <lastname> is really stupid, but i can't modify the source. I want to load in the "url"-attribute from <user> , but only if <name> and <lastname> matches the name values i have stored in my own user database. I know how to parse the rest of it with PHP, but just the matching sequence seems difficult to me. Any help appreciated!

    Read the article

  • Custom IIdentity and passing data from an attribute to a controller

    - by DM
    Here's my scenario: I've successfully created a custom IIdentity that I pass to a GenericPrincipal. When I access that IIdentity in my controller I have to cast the IIdentity in order to use the custom properties. example: public ActionResult Test() { MyCustomIdentity identity = (MyCustomIdentity)User.Identity; int userID = identity.UserID; ...etc... } Since I need to do this casting for nearly every action I would like to wrap this functionality in an ActionFilterAttribute. I can't do it in the controller's constructor because the context isn't initialized yet. My thought would be to have the ActionFilterAttribute populate a private property on the controller that I can use in each action method. example: public class TestController : Controller { private MyCustomIdentity identity; [CastCustomIdentity] public ActionResult() { int userID = identity.UserID; ...etc... } } Question: Is this possible and how? Is there a better solution? I've racked my brain trying to figure out how to pass public properties that are populated in an attribute to the controller and I can't get it.

    Read the article

  • SDL doesn't detect Arrow Keys

    - by Scott
    I am working through the SDL tutorials over at http://lazyfoo.net/SDL_tutorials/index.php and I'm stuck on tutorial 8 where I'm working with key presses. I'm using the following code: //Our Main application loop while(!quit){ if(SDL_PollEvent(&curEvents)){ if(curEvents.type == SDL_QUIT){ quit = true; } //If a key was pressed if( curEvents.type == SDL_KEYDOWN ) { //Set the proper message surface switch( curEvents.key.keysym.sym ) { case SDLK_UP: message = upMessage; break; case SDLK_DOWN: message = downMessage; break; case SDLK_LEFT: message = leftMessage; break; case SDLK_RIGHT: message = rightMessage; break; default: message = TTF_RenderText_Solid(font, "Unknown Key", textColor); break; } } } if( message != NULL ) { //Apply the background to the screen applySurface( 0, 0, background, screen ); //Apply the message centered on the screen applySurface( ( SCREEN_WIDTH - message->w ) / 2, ( SCREEN_HEIGHT - message->h ) / 2, message, screen ); //Null the surface pointer message = NULL; } //Update the screen if( SDL_Flip( screen ) == -1 ) { return 1; } } Where works fine, the default case is reached, for everything BUT pressing the arrow keys. I was wondering if someone could spot what I'm doing wrong.

    Read the article

  • Add KO "data-bind" attribute on $(document).ready

    - by M.Babcock
    Preface I've rarely ever been a JS developer and this is my first attempt at doing something with Knockout.js. The question to follow likely illustrates both points. Backgound I have a fairly complex MVC3 application that I'm trying to get to work with KO (v2.0.0.0). My MVC app is designed to generically control which fields appear in the view (and how they are added to the view). It makes use of partial views to decide what to draw in the view based on the user's permissions (If the user is in group A then show control A, if the user in group B then show control B or possibly if the user is in group A don't include the control at all). Also, my model is very flat so I'm not sure the built-in ability to apply my ViewModel to a specific portion of the view will help. My solution to this problem is to provide an action in my controller that responds with an object in JSON format with that contains the JQuery selector and the content to assign to the "data-bind" attribute and bind the ViewModel to the View in the $(document).ready event using the values provided. Failed Proof-of-concept My first attempt at proving that this works doesn't actually seem to work, and by "doesn't work" I mean it just doesn't bind the values at all (as can be seen in this jsfiddle). I've tried it with the applyBindings inside of the ready event and not, but it doesn't seem to make any bit of difference. Question What am I doing wrong? Or is this just not something that can work with KO (though I've seen at least one example online doing the same thing and it supposedly works)? Like I said in the preface, I've only ever pretended to be a JS developer (though I've generally gotten it to work in the past) so I'm at a loss where to start trying to figure out what I'm doing wrong. Hopefully this isn't a real noob question.

    Read the article

  • how to handle base tag target attribute in iphone uiwebview to open new window

    - by user217428
    When the links are supposed to open a new window, iphone uiwebview won't trigger an event when user click these links. We had to use javascript to do some trick to the target attribute of the links. I can handle 'a' tag to open in the '_self' window with the trick without problem. But when I do it the same way with the 'base' tag. it doesn't work. I believe the base target is set by the javascript. But the base tag is in the head, which may be handled by the uiwebview before my javascript executed, so the target change may not reflected in the webkit engine. Could someone please give some suggestion, so I can open the link in the same uiwebview? The following is the sample HTML opened in the uiwebview <html> <head> <base target='_blank'> </head> <body> <a href='http://google.ca'>google</a> </body> </html> The following is the code to be executed in the (void) webViewDidFinishLoad: (UIWebView*)webView static NSString* js = @"" "function bkModifyBaseTargets()" "{" "var allBases = window.document.getElementsByTagName('base');" "if (allBases)" "{" "for (var i = 0; i < allBases.length; i++)" "{" "base = allBases[i];" "target = base.getAttribute('target');" "if (target)" "{" "base.setAttribute('target', '_self');" "}" "}" "}" "}"; [webView stringByEvaluatingJavaScriptFromString: js]; [webView stringByEvaluatingJavaScriptFromString: @"bkModifyBaseTargets()"];

    Read the article

  • Google Contacts Error: If-Match or If-None-Match header or entry etag attribute required

    - by Ali
    Hi guys I'm following the example code as defined on this website: http://www.ibm.com/developerworks/opensource/library/x-phpgooglecontact/index.html I want to be able to integrate with my google apps account and play around with teh contacts. However I get this error whenever I try to run the modify contacts code: If-Match or If-None-Match header or entry etag attribute required This is my code: Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadClass('Zend_Http_Client'); Zend_Loader::loadClass('Zend_Gdata_Query'); Zend_Loader::loadClass('Zend_Gdata_Feed'); $client = getGoogleClient('cp'); // this is a function I made - its working fine $client->setHeaders('If-Match: *'); $gdata = new Zend_Gdata($client); $gdata->setMajorProtocolVersion(3); $query = new Zend_Gdata_Query($id);// id is the google reference $entry = $gdata->getEntry($query); $xml = simplexml_load_string($entry->getXML()); $xml->name->fullName = trim($contact->first_name).' '.trim($contact->last_name); $entryResult = $gdata->updateEntry($xml->saveXML(), $id);

    Read the article

  • Mapping issue with multi-field primary keys using hibernate/JPA annotations

    - by Derek Clarkson
    Hi all, I'm stuck with a database which is using multi-field primary keys. I have a situation where I have a master and details table, where the details table's primary key contains fields which are also the foreign key's the the master table. Like this: Master primary key fields: master_pk_1 Details primary key fields: master_pk_1 details_pk_2 details_pk_3 In the Master class we define the hibernate/JPA annotations like this: @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idGenerator") @Column(name = "master_pk_1") private long masterPk1; @OneToMany(cascade=CascadeType.ALL) @JoinColumn(name = "master_pk_1", referencedColumnName = "master_pk_1") private List<Details> details = new ArrayList<Details>(); And in the details class I have defined the id and back reference like this: @EmbeddedId @AttributeOverrides( { @AttributeOverride( name = "masterPk1", column = @Column(name = "master_pk_1")), @AttributeOverride(name = "detailsPk2", column = @Column(name = "details_pk_2")), @AttributeOverride(name = "detailsPk2", column = @Column(name = "details_pk_2")) }) private DetailsPrimaryKey detailsPrimaryKey = new DetailsPrimaryKey(); @ManyToOne @JoinColumn(name = "master_pk_1", referencedColumnName = "master_pk_1", insertable=false) private Master master; The goal of all of this was that I could create a new master, add some details to it, and when saved, JPA/Hibernate would generate the new id for master in the masterPk1 field, and automatically pass it down to the details records, storing it in the matching masterPk1 field in the DetailsPrimaryKey class. At least that's what the documentation I've been looking at implies. What actually happens is that hibernate appears to corectly create and update the records in the database, but not pass the key to the details classes in memory. Instead I have to manually set it myself. I also found that without the insertable=true added to the back reference to master, that hibernate would create sql that had the master_pk_1 field listed twice in the insert statement, resulting in the database throwing an exception. My question is simply is this arrangement of annotations correct? or is there a better way of doing it?

    Read the article

  • How to Extract data asocaited with attribute of XML file using python 3.2

    - by user1460383
    I have this xml format..... <event timestamp="0.447463" bustype="LIN" channel="LIN 1"> <col name="Time"/> <col name="Start of Frame">0.440708</col> <col name="Channel">LIN 1</col> <col name="Dir">Tx</col> <col name="Event Type">LIN Frame (Diagnostic Request)</col> <col name="Frame Name">MasterReq_DB</col> <col name="Id">3C</col> <col name="Data">81 06 04 04 FF FF 50 4C</col> <col name="Publisher">TestMaster (simulated)</col> <col name="Checksum">D3 &quot;Classic&quot;</col> <col name="Header Duration">2.090 ms (40.1 bits)</col> <col name="Resp. Duration">4.688 ms (90.0 bits)</col> <col name="Time difference">0.049987</col> <empty/> </event> In above xml, i need to extract data associated with attribute 'name' Am able to get all names but am unable to fetch MasterReq_DB< field Please help me ... Thanks in advance

    Read the article

  • WPF compile error "IDictionary must have a Key attribute"

    - by the empirical programmer
    I've created control styles I want to use among multiple xaml pages in my WPF app. To do this I created a Resources.xaml and added the styles there. Then in my pages I add this code <Grid.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/SampleEventTask;component/Resources.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Grid.Resources> On two pages this works fine, but on the 3rd page I get a compile error that says: All objects added to an IDictionary must have a Key attribute or some other type of key associated with them. If I add a key to this, as such ResourceDictionary x:Key="x", then the compile error goes but on running the app it errors finding the style. I can make the compile error go away and have the app run by just moving original (no key specified) "ResourceDictionary" xaml from the top level Grid into a contained Grid on that page. But I don't understand what is going on here. Any suggestions as to what the problem is, I'm just missing something or doing something incorrectly. Is there a better way to share styles? thanks

    Read the article

  • Spring - How do you set Enum keys in a Map with annotations

    - by al nik
    Hi all, I've an Enum class public enum MyEnum{ ABC; } than my 'Mick' class has this property private Map<MyEnum, OtherObj> myMap; I've this spring xml configuration. <util:map id="myMap"> <entry key="ABC" value-ref="myObj" /> </util:map> <bean id="mick" class="com.x.Mick"> <property name="myMap" ref="myMap" /> </bean> and this is fine. I'd like to replace this xml configuration with Spring annotations. Do you have any idea on how to autowire the map? The problem here is that if I switch from xml config to the @Autowired annotation (on the myMap attribute of the Mick class) Spring is throwing this exception nested exception is org.springframework.beans.FatalBeanException: Key type [class com.MyEnum] of map [java.util.Map] must be assignable to [java.lang.String] Spring is no more able to recognize the string ABC as a MyEnum.ABC object. Any idea? Thanks

    Read the article

  • Nonetype object has no attribute '__getitem__'

    - by adohertyd
    I am trying to use an API wrapper downloaded from the net to get results from the new azure Bing API. I'm trying to implement it as per the instructions but getting the runtime error: Traceback (most recent call last): File "bingwrapper.py", line 4, in <module> bingsearch.request("affirmative action") File "/usr/local/lib/python2.7/dist-packages/bingsearch-0.1-py2.7.egg/bingsearch.py", line 8, in request return r.json['d']['results'] TypeError: 'NoneType' object has no attribute '__getitem__' This is the wrapper code: import requests URL = 'https://api.datamarket.azure.com/Data.ashx/Bing/SearchWeb/Web?Query=%(query)s&$top=50&$format=json' API_KEY = 'SECRET_API_KEY' def request(query, **params): r = requests.get(URL % {'query': query}, auth=('', API_KEY)) return r.json['d']['results'] The instructions are: >>> import bingsearch >>> bingsearch.API_KEY='Your-Api-Key-Here' >>> r = bingsearch.request("Python Software Foundation") >>> r.status_code 200 >>> r[0]['Description'] u'Python Software Foundation Home Page. The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to ...' >>> r[0]['Url'] u'http://www.python.org/psf/ This is my code that uses the wrapper (as per the instructions): import bingsearch bingsearch.API_KEY='abcdefghijklmnopqrstuv' r = bingsearch.request("affirmative+action")

    Read the article

  • While trying to set up Django on Windows: AttributeError: 'Settings' object has no attribute 'DATABA

    - by user326370
    I'm following these instructions in order to set up Django on Windows. I have installed Python 2.6, PostgreSQL 8.4, Psycopg 2.0.14 for Python 2.6 and the latest version of Django from SVN. I'm now following these instructions to run a test project (copied from the page linked to above): C:\Documents and Settings\John>cd C:\ C:\>mkdir django C:\>cd django C:\django>django-admin.py startproject testproject C:\django>cd testproject C:\django\testproject>python manage.py runserver When I run the last line, this is the output: Validating models... Unhandled exception in thread started by <function inner_run at 0x01ECB930> Traceback (most recent call last): File "J:\Python26\lib\site-packages\django\core\management\commands\runserver.py", line 48, in inn er_run self.validate(display_num_errors=True) File "J:\Python26\lib\site-packages\django\core\management\base.py", line 249, in validate num_errors = get_validation_errors(s, app) File "J:\Python26\lib\site-packages\django\core\management\validation.py", line 22, in get_validat ion_errors from django.db import models, connection File "J:\Python26\lib\site-packages\django\db\__init__.py", line 14, in <module> if not settings.DATABASES: File "J:\Python26\lib\site-packages\django\utils\functional.py", line 273, in __getattr__ return getattr(self._wrapped, name) AttributeError: 'Settings' object has no attribute 'DATABASES' Did I forget to do something with the database? Any help will be appreciated. Thank you!

    Read the article

  • Importing fixtures with foreign keys and SQLAlchemy?

    - by Chris Reid
    I've been experimenting with using fixture to load test data sets into my Pylons / PostgreSQL app. This works great except that it fails to properly create foreign keys if they reference an auto increment id field. My fixture looks like this: class AuthorsData(DataSet): class frank_herbert: first_name = "Frank" last_name = "Herbert" class BooksData(DataSet): class dune: title = "Dune" author_id = AuthorsData.frank_herbert.ref('id') And the model: t_authors = sa.Table("authors", meta.metadata, sa.Column("id", sa.types.Integer, primary_key=True), sa.Column("first_name", sa.types.String(100)), sa.Column("last_name", sa.types.String(100)), ) t_books = sa.Table("books", meta.metadata, sa.Column("id", sa.types.Integer, primary_key=True), sa.Column("title", sa.types.String(100)), sa.Column("author_id", sa.types.Integer, sa.ForeignKey('authors.id')) ) When running "paster setup-app development.ini", SQLAlchemey reports the FK value as "None" so it's obviously not finding it: 15:59:48,683 INFO [sqlalchemy.engine.base.Engine.0x...9eb0] INSERT INTO books (title, author_id) VALUES (%(title)s, %(author_id)s) RETURNING books.id 15:59:48,683 INFO [sqlalchemy.engine.base.Engine.0x...9eb0] {'author_id': None, 'title': 'Dune'} The fixture docs actually warn that this might be a problem: "However, in some cases you may need to reference an attribute that does not have a value until it is loaded, like a serial ID column. (Note that this is not supported by the SQLAlchemy data layer when using sessions.)" http://farmdev.com/projects/fixture/using-dataset.html#referencing-foreign-dataset-classes Does this mean that this is just not supported with SQLAlchemy? Or is it possible to load the data without using SA "sessions"? How are other people handling this issue?

    Read the article

  • Passing row from UIPickerView to integer CoreData attribute

    - by Gordon Fontenot
    I'm missing something here, and feeling like an idiot about it. I'm using a UIPickerView in my app, and I need to assign the row number to a 32-bit integer attribute for a Core Data object. To do this, I am using this method: -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { object.integerValue = row; } This is giving me a warning: warning: passing argument 1 of 'setIntegerValue:' makes pointer from integer without a cast What am I mixing up here? --EDIT 1-- Ok, so I can get rid of the errors by changing the method to do the following: NSNumber *number = [NSNumber numberWithInteger:row]; object.integerValue = rating; However, I still get a value of 0 for object.integerValue if I use NSLog to print it out. object.integerValue has a max value of 5, so I print out number instead, and then I'm getting a number above 62,000,000. Which doesn't seem right to me, since there are 5 rows. If I NSLog the row variable, I get a number between 0 and 5. So why do I end up with a completely different number after casting the number to NSNumber?

    Read the article

  • ASP.NET MVC Page - Dropdown control doesn't function with Keyboard Arrow Keys

    - by Rita
    Hi I have a page that has a Dropdown control (ddlDeliveryMethod). So that when the user selects particular option from the Dropdown(using MOUSE), the respective Div ID's are loaded. But instead of Mouse, if we simply use the arrow keys from Keyboard, the respective DIV ID's are not showing. Is there any workaround for this. Appreciate your responses. Here is my code: // based on Delivery method, display the respective fields $("#ddlDeliveryMethod").change(function() { $('#divRegisteredMail').hide(); $('#divRegisteredEmail').hide(); $('#divRegisteredFax').hide(); $('#divSaveForFuture').hide(); switch ($("#ddlDeliveryMethod ").val()) { case ' -- Select one -- ': break; case 'Email': $('#divRegisteredEmail').show(); break; case 'Mail': $('#divRegisteredMail').show(); break; case 'Fax': $('#divRegisteredFax').show(); break; default: caption = "default"; break; } });

    Read the article

  • XML/C#: Read content if only if attribute is correct

    - by Zach
    Hi Guys, I have an XML file as follows, and I'm trying to read the content of the Name tag, only if the attribute of the Record tag is what I want. (continued below code) The XML file is: <?xml version="1.0" encoding="utf-8" ?> <Database> <Record Number="1"> <Name>John Doe</Name> <Position>1</Position> <HoursWorked>290</HoursWorked> <LastMonthChecked>0310</LastMonthChecked> </Record> <Record Number="2"> <Name>Jane Doe</Name> <Position>1</Position> <HoursWorked>251</HoursWorked> <LastMonthChecked>0310</LastMonthChecked> </Record> </Database> This is the C# code I have so far: public static string GetName(int EmployeeNumber) { XmlTextReader DataReader = new XmlTextReader("Database.xml"); DataReader.MoveToContent(); while (DataReader.Read()) { if (DataReader.NodeType == XmlNodeType.Element && DataReader.HasAttributes && DataReader.Name == "Record") { DataReader.MoveToAttribute(EmployeeNumber); DataReader.MoveToContent(); if (DataReader.NodeType == XmlNodeType.Element && DataReader.Name == "Name") { return DataReader.ReadContentAsString(); } } } } So for example, if 2 is passed to the function, I want it to return the string "Jane Doe". I'm new to XML parsing, so any help would be appreciated. Thanks.

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >