Search Results

Search found 22653 results on 907 pages for 'case insensitive'.

Page 25/907 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • thinking sphinx ordering by mixing capitals and lower case

    - by miccet
    I have a rails application that is using thinking_sphinx for the searching. My problem is that the result returned is sorted with capitals first and lower case after it at the bottom. I'd like to mix them so that both 'A' and 'a' comes before 'B'. This is the method I'm using: Company.search(query, :star => true, :page => params[:page], :per_page => 20, :order => :name, :sort_mode => :asc)

    Read the article

  • Trying to create fields based on a case statement

    - by dido
    I'm having some trouble with the query below. I am trying to determine if the "category" field is A, B or C and then creating a field based on the category. That field would sum up payments field. But I'm running into error saying "incorrect syntax near keyword As". I am creating this in a SQL View. Using SQL Server 2008 SELECT r.id, r.category CASE WHEN r.category = 'A' then SUM(r.payment) As A_payments WHEN r.category = 'B' then SUM(r.payment) As B_payments WHEN r.category = 'C' then SUM(r.payment) As C_payments END FROM r_invoiceTable As r GROUP BY r.id, r.category I have data where all of the above cases should be executed because the data that I have has A,B and C Sample Data- r_invoiceTable Id --- Category ---- Payment 222 A ---- 50 444 A ---- 30 111 B ---- 90 777 C ---- 20 555 C ---- 40 Desired Output A_payments = 80, B_payments = 90, C_payments = 60

    Read the article

  • Merge arrow in clear case

    - by cheiav
    Hi, I have to merge all objects from a sub branch to main branch recursively. I would like to merge manually by check in the code from sub branch to main branch instead of using merge command in clear case. So after the check in into the main branch I would like to draw arrow recursively to all my objects. ic from sub branch to main branch I have used this command cleartool mkhlink -unidir Merge <sub branch path>>@@/main/<<sub branch>> <<main brach path>>@@/main/LATEST But when I dit it, it is drawing the arrow for the directory only not for all contains of the directory. Please suggest how to draw the arrow recursively from sub branch to main branch objects. Thanks in advance

    Read the article

  • How to write a CASE WHEN statement with multiple DATEDIFF variables

    - by Anne C
    I need to calculate the difference between two dates (facility_start_date, facility_end_date) for a report in Reporting Services in SQL 2005. If the facility_end_date is null then it needs to use the report parameter @EndDate in the calculation. However if the facility_end_date is greater than the parameter @EndDate, then it also needs to use the paramenter @EndDate. The code below works fine except that if the facility_end_date is greater than the parameter @EndDate it is still calculating between the facility_start_date and facility_end_date, rather than between the facility_start_date and @EndDate. Any help would be appreciated. CASE WHEN facility_start_date > facility_end_date THEN NULL WHEN DATEPART(day , facility_start_date) > DATEPART(day , facility_end_date) THEN DATEDIFF(d , facility_start_date , ISNULL(facility_end_date , @EndDate)) - 1 WHEN DATEPART(day , .facility_end_date) > DATEPART(day , @EndDate) THEN DATEDIFF(d , facility_start_date , @EndDate) - 1 ELSE DATEDIFF(d , facility_start_date , ISNULL facility_end_date , @EndDate)) END

    Read the article

  • Java: Can't implement runnable on a test case: void run() collides

    - by Zombies
    So I have a test case that I want to make into a thread. I cannot extend Thread nor can I implement runnable since TestCase already has a method void run(). The compilation error I am getting is Error(62,17): method run() in class com.util.SeleneseTestCase cannot override method run() in class junit.framework.TestCase with different return type, was class junit.framework.TestResult. What I am trying to do is to scale a Selenium testcase up to perform stress testing. I am not able to use selenium grid/pushtotest.com/amazon cloud at this time (installation issues/install time/resource issues). So this really is more of a Java language issue for me.

    Read the article

  • boost test case for function taking user input

    - by oadams
    I have a function that takes in user input via std::cin: std::getline(std::cin, in); and creates a corresponding data structure by matching it with a regular expression. The function then returns this data structure. I'm using boost.test and I want to create a unit test to check that the output data type is correct given some inputs. However I don't know how to go about it since the input isn't passed as an argument to the function. EDIT: Is there a simple way to create a boost test case that feeds the function a string via standard input?

    Read the article

  • hibernate jpa criteriabuilder ignore case queries

    - by user373201
    How to do a like ignore case query using criteria builder. For description property I want to do something like upper(description) like '%xyz%' I have the following query CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<Person> personCriteriaQuery = criteriaBuilder.createQuery(Person.class); Root<Person> personRoot = personCriteriaQuery.from(Person.class); personCriteriaQuery.select(personRoot); personCriteriaQuery.where(criteriaBuilder.like(personRoot.get(Person_.description), "%"+filter.getDescription().toUpperCase()+"%")); List<Person> pageResults = entityManager.createQuery(personCriteriaQuery).getResultList();

    Read the article

  • C# matching two text files, case sensitive issue

    - by Mike
    What i have is two files, sourcecolumns.txt and destcolumns.txt. What i need to do is compare source to dest and if the text doesnt match write out to a new file. The code below works except i have case sensitive issues like this: CPI Cpi These say they dont match because of captial letters, any help is always thanked! string[] sourcelinestotal = File.ReadAllLines(@"C:\testdirectory\" + "sourcecolumns.txt"); string[] destlinestotal = File.ReadAllLines(@"C:\testdirectory\" + "destcolumns.txt"); foreach (string sline in sourcelinestotal) { if(destlinestotal.Contains(sline)) { } else { File.AppendAllText(@"C:\testdirectory\" + "missingcolumns.txt", sline); } }

    Read the article

  • ExtJS: Combobox in EditorGridPanel not selecting the desired item (with test case)

    - by TomH
    I'm using ExtJS to create an EditorGridPanel with a combobox for an editor in a cell. The combobox in my EditorGridPanel that is not working as I'd expect it to. When the user types the first letter of an item in the drop down list, the combobox seems to ignore it and select the first item in the list. I can reproduce the error consistently and have put together a test case here: http://cluebucket.com/dev/testcase/testcase.html Load the page and reproduce the behavior by the following -- note that this is all done using the keyboard, no mouse clicks: Click 'Add Record' (A new row is added to the grid) enter text in the text field. TAB to the Priority field without selecting anything (None will remain selected) TAB out of the Priority field. (A new row is added to the grid) enter text and TAB to the Priority field TYPE v (Very High is selected) TAB out of the priority field (A new row is added to the grid) enter text and TAB to the Priority field Type v (None is selected, but Very High should have been) TAB out of the priority field Enter text and TAB to the priority field Type l ('el') (Low is selected) TAB out, enter text, TAB to priority Type l (None is selected) It appears that whenever the user attempts to select the same value that was selected in the previous row, the combobox selects None. Any ideas? The code is available at cluebucket.com/dev/testcase/js/testcase.js Thoughts/Pointers/Corrections are appreciated!! thanks tom

    Read the article

  • Scalaz: request for use case

    - by oxbow_lakes
    This question isn't meant as flame-bait! As it might be apparent, I've been looking at Scalaz recently. I'm trying to understand why I need some of the functionality that the library provides. Here's something: import scalaz._ import Scalaz._ type NEL[A] = NonEmptyList[A] val NEL = NonEmptyList I put some println statements in my functions to see what was going on (aside: what would I have done if I was trying to avoid side effects like that?). My functions are: val f: NEL[Int] => String = (l: NEL[Int]) => {println("f: " + l); l.toString |+| "X" } val g: NEL[String] => BigInt = (l: NEL[String]) => {println("g: " + l); BigInt(l.map(_.length).sum) } Then I combine them via a cokleisli and pass in a NEL[Int] val k = cokleisli(f) =>= cokleisli(g) println("RES: " + k( NEL(1, 2, 3) )) What does this print? f: NonEmptyList(1, 2, 3) f: NonEmptyList(2, 3) f: NonEmptyList(3) g: NonEmptyList(NonEmptyList(1, 2, 3)X, NonEmptyList(2, 3)X, NonEmptyList(3)X) RES: 57 The RES value is the character count of the (String) elements in the final NEL. Two things occur to me: How could I have known that my NEL was going to be reduced in this manner from the method signatures involved? (I wasn't expecting the result at all) What is the point of this? Can a reasonably simple and easy-to-follow use case be distilled for me? This question is a thinly-veiled plea for some lovely person like retronym to explain how this powerful library actually works.

    Read the article

  • Would it be possible to fix the right-side panel of my HP HDX laptop with super glue?

    - by lisalisa
    I own a HP HDx16-1140US laptop. I bumped the right corner of my laptop against a door and it caused the plastic piece protecting the USB port, the laptop lock, and the AC port to come off. It looks like it would be an easy repair, but I want to make sure that using super glue won't damage the case or the ports. In the event I can not use it, what would be a good alternative? How it looks with the plastic on How it looks with the plastic off

    Read the article

  • ORM model and DAO in my particular case

    - by EugeneP
    I have the DB structure as follows: table STUDENT (say, id, surname, etc) table STUDENT_PROPERTIES (say, name_of_the_property:char, value_of_the_property:char, student_id:FK) table COURSE (id, name, statusofcourse_id) table STATUSOFCOURSE (id, name_of_status:char ('active','inactive','suspended' etc)) table STUDENT_COURSE (student_id,course_id,statusofcourse_id) Let's try to pick up domain objects in my database: Student and Course are main entities. Student has a list of courses he attends, also he has a list of properties, that is all for this student. Next, Course entitity. It may contain a list of students that attend it. But in fact, the whole structure looks like this: the starting point is Student, with it's PK we can look a list of his properties, then we look into the STUDENT_COURSE and extract both FK of the Course entity and also the Status of the combination, it would look like "Student named bla bla, with all his properties, attends math and the status of it is "ACTIVE". now, quotation 1) Each DAO instance is responsible for one primary domain object or entity. If a domain object has an independent lifecycle, it should have its own DAO. 2) The DAO is responsible for creations, reads (by primary key), updates, and deletions -- that is, CRUD -- on the domain object. Now, first question is What are entities in my case? Student, Course, Student_Course, Status = all except for StudentProperties? Do I have to create a separate DAO for every object?

    Read the article

  • Scalaz: request for use case for Cokleisli composition

    - by oxbow_lakes
    This question isn't meant as flame-bait! As it might be apparent, I've been looking at Scalaz recently. I'm trying to understand why I need some of the functionality that the library provides. Here's something: import scalaz._ import Scalaz._ type NEL[A] = NonEmptyList[A] val NEL = NonEmptyList I put some println statements in my functions to see what was going on (aside: what would I have done if I was trying to avoid side effects like that?). My functions are: val f: NEL[Int] => String = (l: NEL[Int]) => {println("f: " + l); l.toString |+| "X" } val g: NEL[String] => BigInt = (l: NEL[String]) => {println("g: " + l); BigInt(l.map(_.length).sum) } Then I combine them via a cokleisli and pass in a NEL[Int] val k = cokleisli(f) =>= cokleisli(g) println("RES: " + k( NEL(1, 2, 3) )) What does this print? f: NonEmptyList(1, 2, 3) f: NonEmptyList(2, 3) f: NonEmptyList(3) g: NonEmptyList(NonEmptyList(1, 2, 3)X, NonEmptyList(2, 3)X, NonEmptyList(3)X) RES: 57 The RES value is the character count of the (String) elements in the final NEL. Two things occur to me: How could I have known that my NEL was going to be reduced in this manner from the method signatures involved? (I wasn't expecting the result at all) What is the point of this? Can a reasonably simple and easy-to-follow use case be distilled for me? This question is a thinly-veiled plea for some lovely person like retronym to explain how this powerful library actually works.

    Read the article

  • A business Case for Enterprise Python

    - by Srirangan
    Hi all, This will not be a "programming" question but more technology / platform related question. I'm trying to figure out whether Python can be a suitable Java alternative for enterprise / web applications. Which are the ideal cases where you would prefer to use Python instead of Java? How would a typical Python web application (databases/sessions/concurrency) perform as compared to a typical Java application? How do specific Python frameworks square up against Java based frameworks (Spring, SEAM, Grails etc.)? For businesses, switching from the Java infrastructure to a Python infrastructure .. is it too hard/expensive/resource intensive/not viable? Also shed some light on the business case for providing a Python + Google AppEngine based solution to the end customer. Will it be cost effective in an typical scenario? Sorry if I am asking too wide a question, I would have liked to keep it specific, but I need your help to evaluate Python as a whole from the perspectives of the programmers, service providing company and end business customer. For an SME, a Python/GoogleAppEngine based technology stack is a clear scalable and affordable platform. But what about a large MNC that already has a lot invested in Java. Thank you so much. I am researching this myself and will gladly share my conclusions here! Thank you, Srirangan

    Read the article

  • average case running time of linear search algorithm

    - by Brahadeesh
    Hi all. I am trying to derive the average case running time for deterministic linear search algorithm. The algorithm searches an element x in an unsorted array A in the order A[1], A[2], A[3]...A[n]. It stops when it finds the element x or proceeds until it reaches the end of the array. I searched on wikipedia and the answer given was (n+1)/(k+1) where k is the number of times x is present in the array. I approached in another way and am getting a different answer. Can anyone please give me the correct proof and also let me know whats wrong with my method? E(T)= 1*P(1) + 2*P(2) + 3*P(3) ....+ n*P(n) where P(i) is the probability that the algorithm runs for 'i' time (i.e. compares 'i' elements). P(i)= (n-i)C(k-1) * (n-k)! / n! Here, (n-i)C(k-1) is (n-i) Choose (k-1). As the algorithm has reached the ith step, the rest of k-1 x's must be in the last n-i elements. Hence (n-i)C(k-i). (n-k)! is the total number of ways of arranging the rest non x numbers, and n! is the total number of ways of arranging the n elements in the array. I am not getting (n+1)/(k+1) on simplifying.

    Read the article

  • Word VBA - Find text between delimiters and convert to lower case

    - by jJack
    I would like to find text which is between the < and characters, and then turn any found text into "normal" case, where first letter of word is capitalized. Here is what I have thus far: Function findTextBetweenCarots() As String Dim strText As String With Selection .Find.Text = "<" ' what about <[^0-9]+> ? .Find.Forward = True .Find.Wrap = wdFindContinue End With Selection.Find.Execute ' Application.Selection. ' how do I get the text between the other ">"? findCarotSymb = Application.Selection.Text End Function Or, is there a better way of doing this? I also approached the problem using the VBScript Regex 5.5 library, which worked on simple documents, but not on certain documents with complex tables. For example, trying to just bold the text (for simplicity): Sub BoldUpperCaseWords() Dim regEx, Match, Matches Dim rngRange As Range Set regEx = New RegExp regEx.Pattern = "<[^0-9]+>" regEx.IgnoreCase = False regEx.Global = True Set Matches = regEx.Execute(ActiveDocument.Range.Text) For Each Match In Matches ActiveDocument.Range(Match.FirstIndex, Match.FirstIndex + Len(Match.Value)).Bold = True Next End Sub would not work in a document with tables. In fact, it would not even bold the correct text (the text between the <. This leads me to believe I have a broader issue here that I am missing. Here is what a sample doc looks like. Notice the wrong text is bold:

    Read the article

  • What is the JavaScript variable scope in a switch / case statment?

    - by Todd Moses
    While creating JavaScript with ASP.NET MVC I noticed several scope warnings and realized that I am missing something with understanding the variable scope inside the switch / case statement. Warning: 'i' is already defined referring to case b and case c My code looks similar to this: switch(element) { case 'a': for(var i=0; i < count; i++){ do something } break; case 'b': for(var i=0; i < count; i++){ do something } break; case 'c': for(var i=0; i < count; i++){ do something } break; } I thought scope ended with each break statement but it seems that scope does not end until the end of the switch/case. Is scope for the entire switch/case?

    Read the article

  • Anybody makes stylish PC cases that look like the Cobalt Cube?

    - by OverTheRainbow
    Hello I'm looking for computer cases that don't look like regular PC's in case customers would like to keep it on their desktop so it has to look stylish. I liked the Cobalt Cube: http://en.wikipedia.org/wiki/Cobalt_Qube Does someone know if some company makes cases that look the same (I know about Shuttle : they're too pricey), and possibly one that has a really quiet power supply? Thank you.

    Read the article

  • Uppercase and lowercase urls in PHP

    - by Arjun
    I have created folders in my root example: http://www.zipholidays.co.uk/Cuba or http://www.zipholidays.co.uk/Florida When I type http://www.zipholidays.co.uk/cuba (Cube in lowercase), it shows page not found. I'm using Apache server. People are linking to pages with lowercase, uppercase, mixed case - whatever. What do I do to make the pages case insensitive?

    Read the article

  • problem in case of window service

    - by prateeksaluja20
    Hello friends, i made a windows service & add project installer.in which only contain this code. System.Diagnostics.Process.Start(@"C:\Windows\system32\notepad.exe"); inside the timer tick event & interval is 60 sec.i just wanted to try to run Windows service. 1st-serviceProcessInstaller1 i have been changed its account setting as local system. 2nd-serviceInstaller1 in this case i have been changed its start up type as Automatic. then i create a setup add another project then right click add project output then add primary output then press ok. then go to Right click on project-view-custom Action-right click on Install-Add custom Action-select Application folder & add primary output.the same thing done for all the remaining options like commit,rollback,uninstall. after that i build the setup it build succesfully then i install the setup it installed properly into program file n create one .exe file n one Instalfile. but problem is that when i search the service into "services.msc" the service is not there. means service is not showing there.i tried but not getting the ans.plz help me to solve this problem.

    Read the article

  • Minimizing server load in case of many XMLHttpRequest calls

    - by user1888975
    I am making a website where users are to like some articles. Whenever the like button is clicked I am sending a XMLHttpRequest to the server to run a file called like_clicked.php along with the get data of article id and user id. This file takes article id and user id and updates the sql database and also adds a node in an xml file related to the user. This is the first time I am doing something for mass usage. I am worried about the server load when too many users call the like_clicked.php file. Please help me, if this method is ok. I am also thinking of an alternative in case the above method fails. I am thinking of making many like_clicked files (namely like_clicked1.php, like_clicked2.php ... ) to minimize load on a single i-node. Is there a method to detect that it is better to call the next like_clicked file. Here we would need to detect how many calls per unit time are coming for the particular file. How do we handle this? Thanks in advance.

    Read the article

  • case insenstive string replace that correctly works with ligatures like "ß" <=> "ss"

    - by usr
    I have build a litte asp.net form that searches for something and displays the results. I want to highlight the search string within the search results. Example: Query: "p" Results: a<b>p</b>ple, banana, <b>p</b>lum The code that I have goes like this: public static string HighlightSubstring(string text, string substring) { var index = text.IndexOf(substring, StringComparison.CurrentCultureIgnoreCase); if(index == -1) return HttpUtility.HtmlEncode(text); string p0, p1, p2; text.SplitAt(index, index + substring.Length, out p0, out p1, out p2); return HttpUtility.HtmlEncode(p0) + "<b>" + HttpUtility.HtmlEncode(p1) + "</b>" + HttpUtility.HtmlEncode(p2); } I mostly works but try it for example with HighlightSubstring("ß", "ss"). This crashes because in Germany "ß" and "ss" are considered to be equal by the IndexOf method, but they have different length! Now that would be ok if there was a way to find out how long the match in "text" is. Remember that this length can be != substring.Length. So how do I find out the length of the match that IndexOf produces in the presence of ligatures and exotic language characters (ligatures in this case)?

    Read the article

  • Pass command line arguments to JUnit test case being run programmatically

    - by __nv__
    I am attempting to run a JUnit Test from a Java Class with: JUnitCore core = new JUnitCore(); core.addListener(new RunListener()); core.run(classToRun); Problem is my JUnit test requires a database connection that is currently hardcoded in the JUnit test itself. What I am looking for is a way to run the JUnit test programmatically(above) but pass a database connection to it that I create in my Java Class that runs the test, and not hardcoded within the JUnit class. Basically something like JUnitCore core = new JUnitCore(); core.addListener(new RunListener()); core.addParameters(java.sql.Connection); core.run(classToRun); Then within the classToRun: @Test Public void Test1(Connection dbConnection){ Statement st = dbConnection.createStatement(); ResultSet rs = st.executeQuery("select total from dual"); rs.next(); String myTotal = rs.getString("TOTAL"); //btw my tests are selenium testcases:) selenium.isTextPresent(myTotal); } I know about The @Parameters, but it doesn't seem applicable here as it is more for running the same test case multiple times with differing values. I want all of my test cases to share a database connection that I pass in through a configuration file to my java client that then runs those test cases (also passed in through the configuration file). Is this possible? P.S. I understand this seems like an odd way of doing things.

    Read the article

  • Catch test case order [on hold]

    - by DeadMG
    Can I guarantee the order of execution with multiple TEST_CASEs with Catch? I am testing some code using LLVM, and they have some despicable global state that I need to explicitly initialize. Right now I have one test case that's like this: TEST_CASE("", "") { // Initialize really shitty LLVM global variables. llvm::InitializeAllTargets(); llvm::InitializeAllTargetMCs(); llvm::InitializeAllAsmPrinters(); llvm::InitializeNativeTarget(); llvm::InitializeAllAsmParsers(); // Some per-test setup I can make into its own function CHECK_NOTHROW(Compile(...)); CHECK_NOTHROW(Compile(...)); CHECK_NOTHROW(Compile(...)); CHECK_NOTHROW(Compile(...)); CHECK_NOTHROW(Compile(...)); CHECK_NOTHROW(Compile(...)); CHECK_NOTHROW(Compile(...)); CHECK_NOTHROW(Compile(...)); CHECK_NOTHROW(Compile(...)); CHECK_NOTHROW(Compile...)); CHECK_NOTHROW(Interpret(...)); CHECK_THROWS(Compile(...)); CHECK_THROWS(Compile(...)); } What I want is to refactor it into three TEST_CASE, one for tests that should pass compilation, one for tests that should fail, and -one for tests that should pass interpretation (and in the future, further such divisions, perhaps). But I can't simply move the test contents into another TEST_CASE because if that TEST_CASE is called before the one that sets up the inconvenient globals, then they won't be initialized and the testing will spuriously fail.

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >