Search Results

Search found 3722 results on 149 pages for 'choice'.

Page 92/149 | < Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >

  • does a switch idiom make sense in this case?

    - by the ungoverned
    I'm writing a parser/handler for a network protocol; the protocol is predefined and I am writing an adapter, in python. In the process of decoding the incoming messages, I've been considering using the idiom I've seen suggested elsewhere for "switch" in python: use a hash table whose keys are the field you want to match on (a string in this case) and whose values are callable expressions: self.switchTab = { 'N': self.handleN, 'M': self.handleM, ... } Where self.handleN, etc., are methods on the current class. The actual switch looks like this: self.switchTab[selector]() According to some profiling I've done with cProfile (and Python 2.5.2) this is actually a little bit faster than a chain of if..elif... statements. My question is, do folks think this is a reasonable choice? I can't imagine that re-framing this in terms of objects and polymorphism would be as fast, and I think the code looks reasonably clear to a reader.

    Read the article

  • Framework Recommendation request: spring, struts, j2ee?

    - by Jack BeNimble
    The last time I looked at web applications, the consensus seemed to be Struts/J2EE. Now, it looks like Spring MVC/J2EE or Struts/J2EE are both viable solutions. Is this generally correct? Or is Spring MVC now the consensus choice over Struts? We have at least one guy who has worked with Struts before and wants to go with that. I'm more familiar with Struts as well, having reviewed in the past. Also, is J2EE still considered the viable solution for handling remote components? Or are there alternatives?

    Read the article

  • What is the best way to have a dynamic dropdownlist in PHP and POST selected value

    - by mouthpiec
    Hi, I am writing the following in PHP: i would like to have 2 dropdownlists, where the second one is populated from a mySQL dB according to the choice made on the first dropdown list. Then I would like to use the values of the selected values of the dropdownlist to call another PHP page in which I will generate a db query. Eg: List A: Car Manufactures (honda, nissan, etc) List B: Models (accord, civic, etc) Then I will have a submit button, to POST the values in another PHP file? (I have the basics of how to perform the above without having a dynamic list, but I tried this with AJAX, but I am having problems to pass the value of the second dropdownlist) Any tips of how I can perform the above?

    Read the article

  • How to change "Dynamic Web Project" default source and output folders in Eclipse?

    - by Leslie Norman
    How can I change default values of "source folders on build path" and "default output folder" in "Dynamic Web Project" wizard in Eclipse, probably in the way as we do for "Java Project" in Windows Preferences Java Build Path The purpose is: each time I create new Dynamic Web Project, the wizard should show default source and output folders of my choice. Since this option is available for Java project so I believe there should be something similar for Web Projects too but I am unable to find it. BTW I tried changing defaults of Java project but it does not effect dynamic web projects.

    Read the article

  • Is there any framework for Windows Forms, DB driven application development/prototyping?

    - by dolzenko
    I'm writing simple database driven application, 80% of functionality is CRUD operations on about 15 tables. Coming from web development background I figured I can cover almost all of these CRUD cases with Rails scaffolding or say Django admins. So I started to look around for Rails/Django-like framework but for Windows Forms applications (ofcourse I understand that "rich client" application development significantly differs from a web development and I'm not expecting anything really similar). I was surprised that except for a variety of ORMs (let's call it Model-layer) it seems like I'm left with little choice when it comes to View-Controller layer. Maybe I'm missing something? PS. I evaluated Visual Studio DataSet Designer, but it seems to work only for the most simple cases, and requires additional code for any slightly nontrivial task. (added) so far I've found: TrueView for .NET (thanks to Vijay Patel) NConstruct

    Read the article

  • CouchDB Versioning / Auditing

    - by Cory
    I'm attempting to use CouchDB for a system that requires full auditing of all data operations. Because of its built in revision-tracking, couch seemed like an ideal choice. But then I read in the O'Reilly textbook that "CouchDB does not guarantee that older versions are kept around." I can't seem to find much more documentation on this point, or how couch deals with its revision-tracking internally. Is there any way to configure couch either on a per-database, or per-document level to keep all versions around forever? If so, how?

    Read the article

  • Can I get Androis OS?

    - by Michael Turner
    I bought a umpc on ebay, A Ipad touchscreen like device. I had been looking at a particular hardware model that many sellers had, on which was running Android (1.6). I based my choice on the one that offered "free" shipping via UPS (3-5 day) delivery. after the purchase I noticed that the one I bought has Windows CE, not android (!#$^%!!!). Now I want to know if I can get a copy of Android 1.6 or higher and put it on this device. I have looked on google, Torrent sites and ebay, but cannot find a copy of Android OS

    Read the article

  • Changing default image viewer in registry

    - by Phoexo
    I want my application to change the program which should be launched if ie. a .jpg (in the HKEY_CLASSES_ROOT) is launched. The *.jpg and *.jpeg items in the registry references the jpegfile-class, but when I change the value of the default application to open the file, the old default is still launched, but not my program. (I set the value in jpegfile/shell/open/command/ to the path of my application.) In firefox, the right-click menu etc the choice of default viewer will show that my application should be launched, but it isn't.

    Read the article

  • Whats the best data-structure for storing 2-tuple (a, b) which support adding, deleting tuples and c

    - by bhups
    Hi So here is my problem. I want to store 2-tuple (key, val) and want to perform following operations: - keys are strings and values are Integers - multiple keys can have same value - adding new tuples - updating any key with new value (any new value or updated value is greater than the previous one, like timestamps) - fetching all the keys with values less than or greater than given value - deleting tuples. Hash seems to be the obvious choice for updating the key's value but then lookups via values will be going to take longer (O(n)). The other option is balanced binary search tree with key and value switched. So now lookups via values will be fast (O(lg(n))) but updating a key will take (O(n)). So is there any data-structure which can be used to address these issues? Thanks.

    Read the article

  • The State of RDF in Ruby

    - by Daniel
    I'm wondering about the current support there is in Ruby for semantic web technologies. Is there good RDF options? It seems that the last surveys done were circa 2007 ( http://paul-classic.stadig.name/2007/10/26/the-state-of-rdf-support-in-ruby-2007/ ). Is Redland's RDF wrappers the best way to go for RDF support - all the other projects mentioned in that aging article seem to be unsupported or dropped. Is Ruby perhaps a bad choice if one which to pursue projects pertaining to the semantic web?

    Read the article

  • Sending mail via sendmail from python

    - by Nate
    If I want to send mail not via SMTP, but rather via sendmail, is there a library for python that encapsulates this process? Better yet, is there a good library that abstracts the whole 'sendmail -versus- smtp' choice? I'll be running this script on a bunch of unix hosts, only some of which are listening on localhost:25; a few of these are part of embedded systems and can't be set up to accept SMTP. As part of Good Practice, I'd really like to have the library take care of header injection vulnerabilities itself -- so just dumping a string to popen('/usr/bin/sendmail', 'w') is a little closer to the metal than I'd like. If the answer is 'go write a library,' so be it ;-)

    Read the article

  • How to Import Excel Data into Silverlight App for Visualization?

    - by Ulf
    Hi there, Im building an Silverlight Application (Silverlight 4, Visual Studio 2010), in which the user can generate Charts (line-Charts, Bar Chart) dynamically, by entering a specific time period. At the Moment i have no idea how to import the data to Silverlight, to generate the Charts. My data is stored in 4 Excel Tables and i have no clue what would be the best way to get that data into Silverlight? I read a lot of examples using SQL Server as Database, but unfortunatly SQL Server is no choice for me. Any help would be great!

    Read the article

  • CMS for SmartPhones

    - by dde
    The company I work for has a document management and retrieval system. We are noticing employees use more their smartphones than their laptops, but they cannot access the document management system. So, we are thinking about a CMS, with persistent storage, perhaps developed in Java. I just started looking into Jease and dotCMS, and also checked here those recommendations in questions like "Best Open Source Java CMS", etc I find some CMSs too bulky for simple stuff like what we need which is basically document download/edit/upload, and some simple collaboration and personalization stuff. Smartphones of choice in our workforce are Nokia, Blackberry and IPhone, The question is: are there java based with persistent db CMSs aimed at Smartphones right now? I need replication of the complete database and run website offline.

    Read the article

  • InnoDB not supported by webhost. What now?

    - by Peter Perhác
    I was developing a small WAMP web application on my laptop, where I have an instance of mySQL running and I chose InnoDB for my DB engine. After several weeks' development I wanted to make it available to the public and found out the database server provided by my web host does not support InnoDB, only MyISAM. The create-and-populate script generated from the innoDB schema on my laptop, when executed against the live database, can manage to create individual TABLES but then runs into problems creating the VIEWs. Are views not supported in MyISAM? I know FOREIGN KEYs are not. That's very much why I made the choice of InnoDB... What are my chances of making my innoDB schema design work with myISAM? Is there any straightforward way of converting the whole schema from one storage engine to the other? Should I look for another web host that does provide a mysql db that supports innoDB?

    Read the article

  • MSSQL: Primary Key Schema Largely Guid but Sometimes Integer Types...

    - by Code Sherpa
    OK, this may be a silly question but... I have inherited a project and am tasked with going over the primary key relationships. The project largely uses Guids. I say "largely" because there are examples where tables use integral types to reflect enumerations. For example, dbo.MessageFolder has MessageFolderId of type int to reflect public emum MessageFolderTypes { inbox = 1, sent = 2, trash = 3, etc... } This happens a lot. There are tables with primary keys of type int which is unavoidable because of their reliance on enumerations and tables with primary keys of type Guid which reflect the primary key choice on the part of the previous programmer. Should I care that the PK schema is spotty like this? It doesn't feel right but does it really matter? If this could create a problem, how do I get around it (I really can't move all PKs to type int without serious legwork and I have never heard of enumerations that have guid values)? Thanks.

    Read the article

  • Is there a Chrome extension to add mailto links to email addresses?

    - by Martin Burch
    Wait, wait, this is a programming question! I want to build an extension if none exists. Imagine this: you come across a webpage that says "Just send a message to [email protected]" but to actually send the email, you need to highlight the address and then cut and paste it into the recipient field of a new compose window of your email client of choice. Obviously life would be easier if it were simply a mailto: link, so you could click on it and have a new message created automatically. (Or if the page designer had used a form, perhaps ...) I was originally going to ask if there was an extension to enable similar functionality for unlinked twitter @username mentions but I thought this email address problem would be a simpler situation. If you think it would be useless, perhaps I should look at the twitter username problem instead. Thanks for your feedback.

    Read the article

  • Nginx Joomla Internationalization URL rewriting

    - by cl3m
    I'm using Joomla in combination with Nginx, and I'm currently trying to achieve some URL rewriting for a website that has several langages supported (italian, french, chinese, and deutch) The urls have the country code after the domain name, like so : http://www.example.com/fr/test/test.html or http://www.example.com/de/test/test.html I'm looking to rewrite the urls so the country code is part of the subdomain : so http://www.example.com/fr/test/test.html becomes http://fr.example.com/test/test.html Is there a way to achieve this with Nginx or should I look into a third party extension for Joomla (not my favorite choice). Thanks !!

    Read the article

  • TortoiseMerge: is there a way to hide deleted lines in the merge window

    - by baash05
    Hello, I am attempting to merge a large quantity of files. Several of these files are in conflict and TortoiseMerge is the tool of choice. When I view the code in the "merged" windows it shows me all the code that was deleted and added as well as ??? for code that is in-conflict. I am not really sure why it shows me the deleted code, but I do know that I don't want to see it. Seeing lines of code that were removed in a window that is "the results" doesn't make any sense; and, it makes it harder to read the. Is there a way to hide the deleted code in that "results" window so only the text that is actually going to be in the file, shows up? I have read the manual (cursively) and I didn't see anything in there that indicated how to accomplish this (seemingly insignificant) task.

    Read the article

  • Which is the UI technology of the future considering: eye-candy-effect, interactivity (gestures, voc

    - by user193655
    If you had to write a next-gen application, in which on the surface (UI) you need some "futuristic features", by considering the following aspects which is the choice you'd make? 1) eye-candy: cool UI, 3D, Effects, nice graphics, sound transitions... 2) user interaction: not only mouse and keyboard but touch, voice and more.... + user interactivity aspect, which is the technology you'd choose? 3) X-platform: this is to have some X-platform discussion. Of course single platform technologies (as WPF) have may be some more power, anyway in a general discussion considering X-platform as a resource is important 4) available components: of course the coolest technology with no available components is may be an option for a component developer but not for an application developer My question is generic, but anyway * have in mind data-driven apps, not pure multimedia apps, videogames, ....

    Read the article

  • What's the most "death-resistant" component on Android?

    - by Arhimed
    I'm looking for the most suitable class to be a dispatcher for AsyncTasks invoked from my Activities. I think it could be one of these: subclass of Application; subclass of Service; my own static stuff. As for me - it's simlier to implement the 3rd choice. But the question is will it be more "death-resistant" than Service or Application? Also it's very interesting what will live longer - Application or Service? My guess is the Application lives as long as the app (task in terms of Android) process lives. So basically I need to range those options by their "death-resistant" quality, because I'd like to rely on the most "static" thing.

    Read the article

  • Is this crufty?

    - by bobobobo
    I'm writing code like: class Game { int getMouseX() { return inputManager.getMouseX() ; } } ; I remember seeing code like this and hating it. One function passes off to another? What is this "pattern" (or, possibly, anti-pattern) called? I don't like it! On the other hand, it saves exposing the InputManager to the user of the class... would that be a better choice? Or should Game simply not contain InputManager? Edit What about using multiple inheritance instead? class Game : public InputManager, public Window { // by virtue of inheriting InputManager and Window, // Game now has "acquired" the capabilities of // InputManager's public functions, without requiring delegate. } ; Have I not found a reasonably good use for multiple inheritance??

    Read the article

  • use java-ffmpeg wrapper, or simply use java runtime to execute ffmpeg?

    - by user156153
    I'm pretty new to Java, need to write a program that listen to video conversion instructions and convert the video once an new instruction arrives (instructions is stored in Amazon SQS, but it's irrelevant to my question) I'm facing a choice, either use Java RunTime to exec 'ffmpeg' conversion (like from command line), or I can use a ffmpeg wrapper written inJava http://fmj-sf.net/ffmpeg-java/getting%5Fstarted.php I'd much prefer using Java Runtime to exec ffmpeg directly, and avoid using java-ffmpeg wrapper as I have to learn the library. so my question is are there any benefits using java-ffmpeg wrapper over exec ffmpeg directly using Runtime? I don't need ffmpeg to play videos, just convert videos Thanks

    Read the article

  • How Does Differential Execution Work?

    - by Brian
    I've seen a few mentions of this on SO, but staring at Wikipedia and at an MFC dynamic dialog demo did nothing to enlighten me. Can someone please explain this? Learning a fundamentally different concept sounds nice. Edit: I think I'm getting a better feel for it. I guess I just didn't look at the source code carefully enough the first time. I have mixed feelings about DE at this point. On the one hand, it can make certain tasks considerably easier. On the other hand, getting it up and running (i.e. setting it up in your language of choice) is not easy (I'm sure it would be if I understood it better)...though I guess the toolbox for it need only be made once, then expanded as necessary. I think in order to really understand it, I'll probably need to try implimenting it in another language.

    Read the article

  • A balanced binary search tree which is also a heap

    - by saeedn
    I'm looking for a data structure where each element in it has two keys. With one of them the structure is a BST and looking at the other one, data structure is a heap. With a little search, I found a structure called Treap. It uses the heap property with a random distribution on heap keys to make the BST balanced! What I want is a Balanced BST, which can be also a heap. The BST in Treap could be unbalanced if I insert elements with heap Key in the order of my choice. Is there such a data structure?

    Read the article

  • How can I detect collisions between two images in c#?

    - by Shane Callanan
    hope you can help me out with this one. I'm new to c# so am very inexperienced. But basically I'm trying to make a game in which certain objects fall from the sky. Some objects like feathers take a while to drop, while metal balls will drop faster. You start off with a certain amount of cash and can buy weapons of your choice to place on the ground below. Now I've never done anything to do with collisions before, so simple answers will be of much help! Here are some of the collisions that will be in the game: (Not sure if different types of collisions are coded differently) -Collision between bullets and falling objects -Collision between falling objects and the ground (which is inanimate) -Collisions between falling objects and a certain radius around another object (for example, if a weapon gives off a radiation beam starting from its centre) -Collisions between rotating objects (rotating blade) and falling objects If someone could help me with this, it would be much appreciated!

    Read the article

< Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >