Search Results

Search found 1081 results on 44 pages for 'combinations'.

Page 22/44 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • ASP.NET MVC 2 - do UrlParameter.Optional entries have to be at the end of the route?

    - by David M
    I am migrating a site from ASP.NET MVC 1 to ASP.NET MVC 2. At the moment, the site supports the following routes: /{country}/{language}/{controller}/{action} /{country}/{controller}/{action} /{language}/{controller}/{action} /{controller}/{action} The formats for country and language are distinguishable by Regex and have suitable constraints. In MVC 1, I registered each of these as a separate route - for each of around 20 combinations. In MVC 2, I have been trying to get the same thing working with one route to cover all four cases, using UrlParameter.Optional, but I can't seem to get it working - if I define country and language as both optional, then the route /Home/Index for example doesn't successfully match the route. This is what I am trying to do: routes.MapRoute("Default", "{country}/{language}/{controller}/{action}", new { country = UrlParameter.Optional, language = UrlParameter.Optional, controller = "Home", action = "Index" }, new { country = COUNTRY_REGEX, language = LANGUAGE_REGEX }); Is this just impossible because my optionals are at the beginning of the route, or am I just missing something? I can't find any documentation to either tell me what I am doing is impossible or to point me in the right direction.

    Read the article

  • Javascript string to Date conversion - simple?

    - by Mark White
    Hi all, Yesterday I managed to solve this, then lost a day's work due to the death of a HD. Now I cannot remember what I did to fix it, but I know it can be done. Input: string date in the format 'm/d/yy', eg '12/25/10', or '4/1/10' (1st April) Output - Date object I'm working with date.js and date.format.js so have Date.fromString() and Date.format() avaiable. But trying multiple combinations is not giving me what I need. IF the date were 'mm/dd/yy' then it's simple. But I'm using jquery.datepicker.js which outputs in 'm/d/yy' and I don't want to change this much I know this conversion can be done. After a 22 hour day... I need help. Thanks. Mark...

    Read the article

  • Disabling scoring in Lucene(.NET)

    - by user72185
    Hi, When searching, is there a way to disable scoring for any query? The scenario is that the user refines his query by trying different combinations of words, phrases etc., and needs realtime (well, reasonably fast at least) responses on the number of hits. Search time slows down a lot when there are millions of hits due to scoring, but the user really doesn't care about all these documents. As soon as he sees there are 1M+ hits he will start adding additional words to the query. A "Sort by relevance" option would allow him to do this quickly, while turning scoring back on when the number of hits is reasonable. Is this possible? I'm using Lucene.NET 2.9.2 but AFAIK it is identical to the Java version.

    Read the article

  • Circular Shifts on Strings in Bash

    - by Kyle Van Koevering
    I have a homework assignment where I need to take input from a file and continuously remove the first word in a line and append it to the end of the line until all combinations have been done. I really don't know where to begin and would be thankful for any sort of direction. The part that has me confused is that this is suppose to be performed without the use of arrays. I'm not just fishing for someone to solve the problem for me, I'm just looking for some direction. Thank you very much for your time and help. SAMPlE INPUT: Pipes and Filters Java Swing Software Requirements Analysis SAMPLE OUTPUT: Analysis Software Requirements Filters Pipes and Java Swing Pipes and Filters Requirements Analysis Software Software Requirements Analysis Swing Java

    Read the article

  • How to combine specific column values in an SQL statement

    - by Mehper C. Palavuzlar
    There are two variables in our database called OB and B2B_OB. There are EP codes and each EP may have one of the following 4 combinations: EP OB B2B_OB --- -- ------ 3 X 7 X 11 14 X X What I want to do is to combine the X's in the fetched list so that I can have A or B value for a single EP. My conditions are: IF (OB IS NULL AND B2B_OB IS NULL) THEN TYPE = A IF (OB IS NOT NULL OR B2B_OB IS NOT NULL) THEN TYPE = B The list I want to fetch is like this one: EP TYPE --- ---- 3 B 7 B 11 A 14 B How can I do this in my query? TIA.

    Read the article

  • How to add animation on open of a Jquery SimpleModal?

    - by Obay
    The animation-enabled example in the SimpleModal site has this animation: 1. Fade in the overlay 2. Slide down the modal div This is the code: $("#the-div").modal({ onOpen: function (dialog) { dialog.overlay.fadeIn('fast', function () { dialog.data.hide(); dialog.container.show('fast', function () { dialog.data.slideDown('fast'); }); }); }}); I want this animation instead: 1. Just display the modal 2. Fade in the overlay Alas, simply removing the 2nd parameter of dialog.overlay.fadeIn() from the code above doesn't work. I also tried removing the parameters of dialog.container.show(), also changing it to dialog.container.open(). I've tried other combinations of the code, to no avail. How do I achieve the animation that I wish?

    Read the article

  • How to make strtotime parse dates in Australian (i.e. UK) format: dd/mm/yyyy?

    - by Iain Fraser
    I can't beleive I've never come across this one before. Basically, I'm parsing the text in human-created text documents and one of the fields I need to parse is a date and time. Because I'm in Australia, dates are formatted like dd/mm/yyyy but strtotime only wants to parse it as a US formatted date. Also, exploding by / isn't going to work because, as I mentioned, these documents are hand-typed and some of them take the form of d M yy. I've tried multiple combinations of setlocale but no matter what I try, the language is always set to US English. I'm fairly sure setlocale is the key here, but I don't seem to be able to strike upon the right code. Tried these: au au-en en_AU australia aus Anything else I can try? Thanks so much :) Iain Example: $mydatetime = strtotime("9/02/10 2.00PM"); echo date('j F Y H:i', $mydatetime); Produces 2 September 2010 14:00 I want it to produce: 9 February 2010 14:00

    Read the article

  • Native Mouse events with Flash and Selenium

    - by Dan at Demand
    I understand that Selenium does not support Flash, but it is my understanding that I should be able to do some simplistic testing of Flash by using Selenium's built in native mouse support and doing mouse up/down events based on coordinates. Is this correct? I can't seem to get it working. I'm trying to test on this page: http://mandy-mania.blogspot.com/2010/04/sneak-peek-of-final-season-of-lost-dvd.html and all I'm trying to do is click on the flash object so it plays the video. I've tried all sorts of commands, MouseOver, MouseDown, MouseDownAt, MouseUp, MouseUpAt, etc. So, I'm wondering if this just theoretically doesn't work or if I'm just doing something wrong. The xpath I'm using is //object[@id='player'], although I've tried a number of different combinations. And yes, I've also tried just the straight click command. Any suggestions? Thanks!

    Read the article

  • OpenCV, Python (ctypes), and OS X 10.5: dylib errors/confusion

    - by Jeff
    I have tried two brands of ctypes (ctypes-opencv and another) wrappers for OpenCV (2.0 from svn head), can use Python and OpenCV in the Python console, but whenever I try to import the packages (from ctypes_opencv import *) from another Python file, I get the following error message: OSError: dlopen(/usr/local/lib/libcv.dylib, 6): Symbol not found: __ZN2cv10fastMallocEm Referenced from: /usr/local/lib/libcv.dylib Expected in: flat namespace And some more Python errors: module body in __init__.py at line 18 from ctypes_opencv.cxcore import * module body in cxcore.py at line 80 _cxDLL, _cvDLL, _hgDLL = detect_opencv() function detect_opencv in cxcore.py at line 59 cvDLL = cdll.LoadLibrary(find_lib('cv')) function LoadLibrary in __init__.py at line 431 return self._dlltype(name) function __init__ in __init__.py at line 353 self._handle = _dlopen(self._name, mode) I most recently built OpenCV using flags the ctypes_opencv wiki recommended: ENABLE_SSE(2) OFF and BUILD_NEW_PYTHON_SUPPORT OFF. I've tried a number of flag combinations though. I also tried using the MacPorts install of OpenCV, got the same messages, uninstalled it, and now it errors out as well. :P And if that wasn't enough, I tried using the latest ctypes wrapper, but get boost-jam errors. Any help would be very much appreciated.

    Read the article

  • ForceType text/html;charset=utf-8 in .htaccess is causing all externally linked CSS to stop renderin

    - by chimerical
    I'm using: ForceType text/html;charset=utf-8 in my .htaccess file, but it's causing all externally linked CSS to stop rendering on their respective pages. So something like this: <link rel="stylesheet" type="text/css" href="somestyles.css" media="all" /> no longer works on the page using it. I've also been trying combinations of: AddCharset utf-8 .html AddCharset utf-8 .htm AddCharset utf-8 .css AddCharset utf-8 .js ForceType text/html;charset=utf-8 ForceType text/css;charset=utf-8 but no luck so far. Does anyone know what's wrong?

    Read the article

  • Find cheapest price for X number of days

    - by user76152
    Hey 'FLow. I have a technical challenge for you regarding an algorithm. Lets say I have this list of days and prices: List<ReservationPrice> prices = new List<ReservationPrice>(); prices.Add(new ReservationPrice { NumberOfDays = 1, Price = 1000 }); prices.Add(new ReservationPrice { NumberOfDays = 2, Price = 1200 }); prices.Add(new ReservationPrice { NumberOfDays = 3, Price = 2500 }); prices.Add(new ReservationPrice { NumberOfDays = 4, Price = 3100 }); prices.Add(new ReservationPrice { NumberOfDays = 7, Price = 4000 }); What I would like to able to do now is: give me the best price from the list based on a number of days. So if ask for 3 days the best price from the list is from child one (1000) and two (1200), but there are of course different combinations you would have to try out at first. How would an algorithm that found the best price from this list look like ? Thank you!

    Read the article

  • Algorithm for evaluating nested logical expression

    - by TravelingSalesman
    I have a logical expression that I would like to evaluate. The expression can be nested and consists of T (True) or F (False) and parenthesis. The parenthesis "(" means "logical OR". Two terms TF beside each others (or any other two combinations beside each others), should be ANDED (Logical AND). For example, the expression: ((TFT)T) = true I need an algorithm for solving this problem. I thought of converting the expression first to disjunctive or conjunctive normal form and then I can easily evaluate the expression. However, I couldn't find an algorithm that normalizes the expression. Any suggestions? Thank you. The problem statement can be found here: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=2&category=378&page=show_problem&problem=2967

    Read the article

  • Assert parameters in a table-valued UDF

    - by Clay Lenhart
    Is there a way to create "asserts" on the parameters of a table-valued UDF. I'd like to use a table-valued UDF for performance reasons, however I know that certain parameter combinations (like start and end dates that are more than a month apart) will cause performance issues on the server for all users. End users query the database via Excel using UDFs. UDFs (and table-valued UDFs in particular) are useful when the data is too large for Excel. Users write simple SQL queries that categorizes the data into groups to reduce the number of rows. For example, the user may be interested in weekly aggregates rather than hourly ones. Users write a group by SELECT statement to reduce the rows by 24x7=168 times. I know I can write RAISERROR statements in multistatement UDFs, but table-valued UDFs are integrated in the query optimizer so these queries are more efficient with table-valued UDFs. So, can I define assertions on the parameters passed to a table-valued UDF?

    Read the article

  • Why does asp.net mvc form submits itself on button clicks when javascript function error?

    - by melaos
    hi guys, i'm new to the asp.net mvc, and while working on this, i used very basic asp.net mvc stuff like beginform, etc. i used a lot of jquery codes this round for client side validation, ajax data retrieval, and other gui works. and i used a combinations of html inputs buttons, etc and the asp.net mvc type of controls. what i noticed is that whenever i click on a button control, which sometimes are tied to either jquery oclick events, when there's a javascript error, the page will just go on and submit. why is this happening and what am i missing here? my bad for the dumb questions.. thanks

    Read the article

  • Display Img and Div inline - it's not rendered inline

    - by user359372
    In order to follow correct web standards, I've tried to layout image and div inline. In orde to achieve that - I've used display:inline property. But then I experienced the following issue: image renders from the center line, and div doesn't respect height parameter set to it. I've tried using line-height parameter, but that didn't give any useful results. I've also tried various combinations with setting margin/padding to some values or to auto, or replacing div with span, or wrapping img and div with additional divs. I've managed to achieve desired result by using position:absolute, but that doesn't help in cases where I want to use centered/relative positioning of the whole component... Any clues or ideas or troubleshooting hints? Please find the html example below: Test Page Some text that should be displayed in the center/middle of the div 123   Some text that should be displayed in the center/middle of the div

    Read the article

  • how to implement IOC without a global static service (non-service locator solution)?

    - by Michel
    Hi, we want to use Unity for IOC. All i've seen is the implementation that there is one global static service which holds a reference to the Unity container, which registers all interface/class combinations and every class asks that object: give me an implementation for Ithis or IThat. Frequently i see a response that this pattern is not good because it leads to a dependency from ALL classes to this service. But what i don't see often, is: what is the alternative way? Michel EDIT: found out that the global static service is called the service locator, added that to the title.

    Read the article

  • Coda Clips for Vim

    - by XLR3204S
    I'm currently trying to switch from Coda (a Mac IDE) to Vim. One thing I loved about Coda and my knowledge of Vim cannot replace were the so-called "clips". Basically, you type, say, "new", press TAB, and the text is replaced with a basic XHTML page. And you can add as many keyword/clips combinations as you want. The most I could get with Vim so far was to create a new file containing my clip, and then use :r FILE in Vim in order to get it inserted, but this is not a very elegant solution, as I'd have to carry these clips around in every directory I have a file I want to use my clips with. So assuming I've explained things properly, what would be my choices?

    Read the article

  • total number of magic square from 9 numbers

    - by Peeyush
    9 numbers need to be arranged in a magic number square. A magic number square is a square of numbers that is arranged such that every row and column has the same sum.(condition for diagonal has been relaxed) For example: 1 2 3 3 2 1 2 2 2 How do we calculate total number of distinct magic square from 9 numbers. Two magic number squares are distinct if they differ in value at one or more positions. For example, there is only one magic number square that can be made of 9 instances of the same number. e.g. for these 9 numbers { 4, 4, 4, 4, 4, 4, 4, 4, 4 }, answer should be 1. Also the complexity should be optimal. Do we need to iterate through all the permutations , discarding if a[0]+a[1]+a[2] %3!=0 such combinations ? moreover how do we remove duplicate magic square?

    Read the article

  • Good book suggestions for building enterprise software

    - by ncoder
    Enterprise software are built using technologies/softwares/terminologies/APIs such as EJB, JBoss, Seam, Hibernate(JPA), Maven, Eclipse, Spring, JTS, JMS, JNDI etc. I know there are great books out there for each of these individually, however can someone suggest a book or two that covers all (or most of) these topics in lesser detail and gives examples of how these are integrated? I have intentionally left the client side stuff out because its highly unlikely a single book would cover that much. If anyone knows of a book (or books) that cover most of or various combinations (like EJB, Hibernate, Spring and Seam) of these technologies, please do suggest the same. The idea is not to become an expert in all however know about them in reasonable detail and why each one is required.

    Read the article

  • Code Golf: Phone Number to Words

    - by Nick Hodges
    Guidelines for code-golf on SO We've all seen phone numbers that are put into words: 1-800-BUY-MORE, etc. What is the shortest amount of code you can write that will produce all the possible combinations of words for a 7 digit US phone number. Input will be a seven digit integer (or string, if that is simpler), and assume that the input is properly formed. Output will be a list of seven character strings that For instance, the number 428-5246 would produce GATJAGM GATJAGN GATJAGO GATJAHM GATJAHN GATJAHO and so on..... Winning criteria will be code from any language with the fewest characters that produce every possible letter combination. Additional Notes: To make it more interesting, words can be formed only by using the letters on a North American Classic Key Pad phone with three letters per number as defined here.That means that Z and Q are excluded. For the number '1', put a space. For the number '0', put a hyphen '-' Bonus points awarded for recognizing output as real English words. Okay, not really. ;-)

    Read the article

  • Accessing PostGIS spatial data from Rails

    - by Lakitu
    I need to use an existing PostGIS database from my Rails application. So far I am able to access the DB just fine, GeoRuby nicely converts the 'geom' column into a Point object. What I am looking for is an easy way to execute ActiveRecord-like queries on those tables, e.g. Poi.find_within_radius(...) or similar spatial queries like distance calculations et. al. I tried several combinations of geokit, accompanying rails plugins but I'm quite sure there must be something better out there in the ruby/rails universe. Any hints?

    Read the article

  • Get group key from bridge table

    - by Mads Jensen
    I'm developing an ETL process, and need a bridge table for a one-to-many relationship between a fact table and a dimension table (MySQL database). There is a limited number of combinations (some thousands), so I want to re-use group keys from the bridge table to to limit the size. Any group of dimensions belonging to a fact row will consist of a number of dimension keys (1 to around 15), assigned to a unique group key, as below: group_key | dimension_key ----------------------- 1 | 1 1 | 3 1 | 4 2 | 1 2 | 2 2 | 3 3 | 1 3 | 4 How do I go about retrieving the unique group key for the dimensions 1,3,4 (ie. 1).

    Read the article

  • MPI4Py Scatter sendbuf Argument Type?

    - by Noel
    I'm having trouble with the Scatter function in the MPI4Py Python module. My assumption is that I should be able to pass it a single list for the sendbuffer. However, I'm getting a consistent error message when I do that, or indeed add the other two arguments, recvbuf and root: File "code/step3.py", line 682, in subbox_grid i = mpi_communicator.Scatter(station_range, station_data) File "Comm.pyx", line 427, in mpi4py.MPI.Comm.Scatter (src/ mpi4py_MPI.c:44993) File "message.pxi", line 321, in mpi4py.MPI._p_msg_cco.for_scatter (src/mpi4py_MPI.c:14497) File "message.pxi", line 232, in mpi4py.MPI._p_msg_cco.for_cco_send (src/mpi4py_MPI.c:13630) File "message.pxi", line 36, in mpi4py.MPI.message_simple (src/ mpi4py_MPI.c:11904) ValueError: message: expecting 2 or 3 items Here is the relevant code snipped, starting a few lines above 682 mentioned above. for station in stations #snip--do some stuff with station station_data = [] station_range = range(1,len(station)) mpi_communicator = MPI.COMM_WORLD i = mpi_communicator.Scatter(station_range, nsm) #snip--do some stuff with station[i] nsm = combine(avg, wt, dnew, nf1, nl1, wti[i], wtm, station[i].id) station_data = mpi_communicator.Gather(station_range, nsm) I've tried a number of combinations initializing station_range, but I must not be understanding the Scatter argument types properly. Does a Python/MPI guru have a clarification this?

    Read the article

  • SMO some times doesn't display the instances in sql2008 cluster

    - by Cute
    Hi I have used SMO API.in that i have used SmoApplication.EnumAvailableServers(FALSE) and from that i have filtered local instances i have used this approch insted of true to make this as convinent for remote sqldiscovery also.using that api created a dll and use that dll in c++. Now this is working in all combinations but some times it is failed to retrieve the instannces in win2008 sql2008 cluster combination. if i run the exe for 5 times it got succeed for 3 times and failed for two times... What is wromg with win-sql2008 cluster .is there any additional changes needed to make it work properrly.My firewall is off and also added exception for tcp port 1433. Anyy help is greately Appreciated... Thanks in Advance.

    Read the article

  • Removing whitespace between HTML elements when using line breaks

    - by Skilldrick
    I have a page with a row of about 10 imgs. For readability of the HTML, I want to put a linebreak in between each img tag, but doing so renders whitespace between the images, which I do not want. Is there anything I can do other than break in the middle of the tags rather than between them? Edit: Here is a screenshot of what I have so far. I would like the book spine images to display in random combinations, using PHP. This is why I need separate img tags.

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >