Search Results

Search found 18361 results on 735 pages for 'hibernate search'.

Page 218/735 | < Previous Page | 214 215 216 217 218 219 220 221 222 223 224 225  | Next Page >

  • Search for dates in excel

    - by Jean
    Hello, I have dates in an excel field of these formats, 01-jan-10, 02/02/05. I formated the cells to 03-mar-2010. I did a find such as 03-mar-2010 does not turn up any result. Any reason to why. Thanks Jean

    Read the article

  • php search database for row

    - by Brenden Morley
    Okay I got code the code to pull data based on a users account number well here is what im using (And yes I know it isnt safe now that is the reason for my post) <?php include('config.php'); $user_info = fetch_user_info($_GET['AccountNumber']); ?> <html> <body> <div> <?php if ($user_info === false){ $Output = 'http://www.MyDomain.Com/'; echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$Output.'">'; }else{ ?> <center> <title><?php echo $user_info['FirstName'], ' ', $user_info['LastName'], ' - ', $user_info['City'], ', ', $user_info['State']; ?> - Name of site</title> So basically what this code is allowing me to do is have a file called Profile.php And when a user visits this this page it will return the data Like this http://MyDomain.com/Profile.php?AccountNumber=50b9c965b7c3b How can I do this securely cause right now its using a get method really unsafe to retive the account number from the url bar.

    Read the article

  • Limiting a search to records from last_request_at...

    - by bgadoci
    I am trying to figure out how to display a count for records that have been created in a table since the last_request_at of a user. In my view I am counting the notes of a question with the following code: <% unless @questions.empty? %> <% @questions.each do |question| %> <%= h(question.notes.count) %> end end This is happening in the /views/users/show.html.erb file. Instead of counting all the notes for the question, I would only like to count the notes that have been created since the users last_request_at datetime. I don't neccessarily want to scope notes to display this 'new notes' count application wide, just simply in this one instance. To accomplish I am assuming I need to create a variable in the User#show action and call it in the view but not really sure how to do that. Other information you may need: class Note < ActiveRecord::Base belongs_to :user belongs_to :question end class Question < ActiveRecord::Base has_many :notes, :dependent => :destroy belongs_to :user end

    Read the article

  • Haskell search an element on a List

    - by user1887556
    I want a function that changes (1 to 0) on a list, when number of 1's isn't even. I have done these functions: 1) Sees if the lines in a list are even or not: parityLine :: [[Int]] -> [Bool] parityLine [] =[] parityLine (x:xs) |sum(x) `mod` 2 == 0 = True:(parityLine(xs)) |otherwise = False:(parityLine(xs)) 2) Sum the corresponding elements on a list of lists: sumPositions :: [[Int]] -> [Int] sumPositions [] = [] sumPositions (x:xs) = foldl (zipWith (+)) (repeat 0) (x:xs) 3) Sees if the columns in a list are even or not: parityColumn :: [Int] -> [Bool] parityColumn [] = [] parityColumn (x:xs) |head(x:xs) `mod` 2 == 0 = True:parityColumn(xs) |otherwise = False:parityColumn(xs) 4) Does the operation or with two boolean lists: bol :: [Bool] -> [Bool] -> [[Bool]] bol [] _ = [] bol (x:xs) (y:ys)= (map (||x) (y:ys)):(bol xs (y:ys)) 5) Correct List: correct :: [[Int]] -> [[Bool]] correct [] = [] correct (x:xs)=(bol(parityLine (x:xs))(parityColumn(sumPositions(x:xs)))) So what I want is to alter the function correct to [[Int]]-[[Int]] that does this: My Int list(x:xs) With my correct function applied [[0,0,1,1], [[True,True,False,True], [1,0,1,1], [True,True,True,True], [0,1,0,1], [True,True,True,True] [1,1,1,1]] [True,True,True,True]] Now I can see that in the first line third column, False, so I have to correct that number 1 to have a number of 1's even. Result I want that function correct does: [[0,0,0,1], [1,0,1,1], [0,1,0,1], [1,1,1,1]] Thanks.

    Read the article

  • java - Depth First Search - Perform DFS on a tree

    - by DJDonaL3000
    Im trying to perform DFS on a Minimum Spanning Tree which contains 26 nodes. Nodes are named 'A' to 'Z' and the tree is undirected. I have an empty function called DFS here that I am trying to write, which (i presume) takes in the tree (a 2D array) a startNode (randomly selected node 'M') and the endNode (randomly selected node 'Z'). The weights of connected nodes are identified in the 2D array parameter, but how do I actually get started visiting nodes? All that is required is to print each nodeName in the order of the DFS traversal. Do I need to create a Node_class for each node in the 2d array??

    Read the article

  • jQuery Hide Div(s) on focus of drop down menu or text (live search) input

    - by webwrks
    Can anyone help me? I'm trying to hide the #hideme div when the a user clicks the drop down menu (to select something) or puts the focus on the text field. Thanks! #hideme { background:#ccc; } <script> $(function(){ $('#skill_select').click(function(){ $('#hideme').hide(); }); }): </script> <select> <option selected="selected">Pick from the list</option> <option>Option One</option> <option>Option Two</option> </select> or <input type="text" value="type something"> <br/><br/> <div id="hideme">Hide Me Please</div>

    Read the article

  • Contact picker with search function

    - by tiex
    This question1 describes a way how to show list of phone numbers and select one of them if my app needs a phone number. But image if I have a huge contact list, it is not enough to just show list but possibility for filtering (by contact's name) is also needed. Is there a standard way to show phones list with picking possibility and with filtering possibility? (I wouldn't like to invent my own) Is there a solution for the problem for sdk 2.0 and lower?

    Read the article

  • MongoDB search in C#

    - by user3684208
    I have a problem with querying MongoDB. In my code I have a method Get which has as a parametar a Dictionary. It should go through the database and query it, comparing string and then object. So, i always get a problem with this object part, QueryDocument won't take in an object type because it isn't an BsonValue. I have tried to cast it but it won't work. Do you have any suggestions ? Thanks Code part : public List<ExceptionViewModel> Get(Dictionary<string, object> FilteredExceptions) { MongoClient mongo = new MongoClient(); MongoServer mongoServer = mongo.GetServer(); MongoDatabase db = mongoServer.GetDatabase("Aplikacija"); MongoCollection collection = db.GetCollection("Exceptions"); List<ExceptionViewModel> Get = new List<ExceptionViewModel>(); foreach (KeyValuePair<string,object> item in FilteredExceptions) { var query = new QueryDocument(item.Key.ToString(),item.Value); foreach (ExceptionViewModel exception in collection.FindAs<ExceptionViewModel>(query)) { Console.WriteLine("{0}", exception.BrowserName); } } return Get; }

    Read the article

  • Simple Search and Replace use of Regular Expression

    - by nunos
    So, I am adapting some code I found online to suit my needs. However, my set_pixel function has two more parameters. Since there are lots of calls to this function even doing a quick paste over would be very tedious. So, I thought this would be a good time for me to learn some simple regular expressions. So, I have calls of this type: set_pixel(arg1, arg2); which I want to change to something like: set_pixel(arg1, arg2, arg3, arg4); Note: arg1 and and 2 should be preserved, whereas arg3 and arg4 are most of the time the same. How can I achieve this?

    Read the article

  • Search and replace in apache htaccess a RewriteRule

    - by Paul Irish
    I'd basically like to get /path/file+name+with+plusses.mp3 to rewrite to /path/file name with plusses.mp3 In my case wordpress is intercepting the request and giving a 404. But the file does indeed exist. Given the constraints of the regex in mod_rewrite implementation, I haven't yet seen a straightforward way of doing this.

    Read the article

  • [C#] RegEx search for two pattern strings and cut what's between

    - by gsharp
    I'm trying to write a little SQL Helper. I have a query like this stored in a string: DECLARE @V1 INT --ignore DECLARE @V11 INT DECLARE @V12 INT --endignore DECLARE @V2 INT --ignore SELECT * FROM SampleTable INNER JOIN AnotherSampleTable ...... --endignore SELECT * From Employee ORDER BY LastName My helper method should cut everything what's between --ignore and --endignore The result string should look like: DECLARE @V1 INT DECLARE @V2 INT SELECT * From Employee ORDER BY LastName How can achieve my result with RegEx?

    Read the article

  • Optimizing near-duplicate value search

    - by GApple
    I'm trying to find near duplicate values in a set of fields in order to allow an administrator to clean them up. There are two criteria that I am matching on One string is wholly contained within the other, and is at least 1/4 of its length The strings have an edit distance less than 5% of the total length of the two strings The Pseudo-PHP code: foreach($values as $value){ foreach($values as $match){ if( ( $value['length'] < $match['length'] && $value['length'] * 4 > $match['length'] && stripos($match['value'], $value['value']) !== false ) || ( $match['length'] < $value['length'] && $match['length'] * 4 > $value['length'] && stripos($value['value'], $match['value']) !== false ) || ( abs($value['length'] - $match['length']) * 20 < ($value['length'] + $match['length']) && 0 < ($match['changes'] = levenshtein($value['value'], $match['value'])) && $match['changes'] * 20 <= ($value['length'] + $match['length']) ) ){ $matches[] = &$match; } } } I've tried to reduce calls to the comparatively expensive stripos and levenshtein functions where possible, which has reduced the execution time quite a bit. However, as an O(n^2) operation this just doesn't scale to the larger sets of values and it seems that a significant amount of the processing time is spent simply iterating through the arrays. Some properties of a few sets of values being operated on Total | Strings | # of matches per string | | Strings | With Matches | Average | Median | Max | Time (s) | --------+--------------+---------+--------+------+----------+ 844 | 413 | 1.8 | 1 | 58 | 140 | 593 | 156 | 1.2 | 1 | 5 | 62 | 272 | 168 | 3.2 | 2 | 26 | 10 | 157 | 47 | 1.5 | 1 | 4 | 3.2 | 106 | 48 | 1.8 | 1 | 8 | 1.3 | 62 | 47 | 2.9 | 2 | 16 | 0.4 | Are there any other things I can do to reduce the time to check criteria, and more importantly are there any ways for me to reduce the number of criteria checks required (for example, by pre-processing the input values), since there is such low selectivity?

    Read the article

  • Binary Search Tree, cannot do traversal

    - by ihm
    Please see BST codes below. It only outputs "5". what did I do wrong? #include <iostream> class bst { public: bst(const int& numb) : root(new node(numb)) {} void insert(const int& numb) { root->insert(new node(numb), root); } void inorder() { root->inorder(root); } private: class node { public: node(const int& numb) : left(NULL), right(NULL) { value = numb; } void insert(node* insertion, node* position) { if (position == NULL) position = insertion; else if (insertion->value > position->value) insert(insertion, position->right); else if (insertion->value < position->value) insert(insertion, position->left); } void inorder(node* tree) { if (tree == NULL) return; inorder(tree->left); std::cout << tree->value << std::endl; inorder(tree->right); } private: node* left; node* right; int value; }; node* root; }; int main() { bst tree(5); tree.insert(4); tree.insert(2); tree.insert(10); tree.insert(14); tree.inorder(); return 0; }

    Read the article

  • Search for values in nested array

    - by dardub
    I have an array as follows array(2) { ["operator"] => array(2) { ["qty"] => int(2) ["id"] => int(251) } ["accessory209"] => array(2) { ["qty"] => int(1) ["id"] => int(209) } ["accessory211"] => array(2) { ["qty"] => int(1) ["id"] => int(211) } } I'm trying to find a way to verify an id value exists within the array and return bool. I'm trying to figure out a quick way that doesn't require creating a loop. Using the in_array function did not work, and I also read that it is quite slow. In the php manual someone recommended using flip_array() and then isset(), but I can't get it to work for a 2-d array. doing something like if($array['accessory']['id'] == 211) would also work for me, but I need to match all keys containing accessory -- not sure how to do that Anyways, I'm spinning in circles, and could use some help. This seems like it should be easy. Thanks.

    Read the article

  • Suggestions on search in android?

    - by Praveen Chandrasekaran
    i can implement the QSB on my app using onSearchRequested() method.i have 4 column in my table. when i was type in the QSB. it will give some suggestions on the Suggestion window. how to do that? searchable dictionary example shows the dictionary provider class to retrive the suggestions. but on that no data inserted. then how they getting the suggestions. can you explain me what are the steps we have to follow or tutorials, sample codes are most thankful.

    Read the article

  • Highlighting search words like Chrome with jQuery

    - by ilkin
    I have recently done a very simple highlighting with jQuery and a highlight plugin. It looks like this: $('myButton').click(function() { $('body').highlight($('#myInputText').val()); }); But I wonder how can I do the Chrome like highlighting, I mean highlight the letters whenever I type in some letter in textbox without submitting. I think maybe use a keyup event... Any ideas?

    Read the article

  • Best way to search a point across several polygons

    - by user1474341
    I have a requirement whereby I need to match a given point (lat,lon) against several polygons to decide if there is a match. The easiest way would be to iterative over each polygon and apply the point-in-polygon check algorithm, but that is prohibitively expensive. The next optimization that I did was to define a bounding rectangle for each polygon (upper bound, lower bound) and iteratively check the point against the bounding box (fewer comparisons as against checking all the points in the polygon). Is there any other optimization possible? Would a spatial index on the bound rectangle points or a geohash help ? Any guidance would be greatly appreciated. Thanks!

    Read the article

  • php string search - grabbing specific urls

    - by MEM
    Hello, I have this string that may contain some urls that I need to grab. For instance, if the user does: www.youtube ... or www.vimeo ... or http://www.youtube ... or HttP://WwW.viMeo I need to grab it (until he finds a space perhaps). and store it on a already created array. The need is to separate the vimeo links from the youtube ones and place each of those on the appropriate video object. I'm not sure if this is possible, I mean, if the URL coming from the browser could be used to be placed on a predefined video object. If it is, then this is the way to go (so I believe). If all this is feasible, can I have your help in order to build such a rule? Thanks in advance

    Read the article

  • Java : Count even values in a Binary Search Tree recursively

    - by user307682
    Hi, I need to find out how many even values are contained in a binary tree. this is my code. private int countEven(BSTNode root){ if ((root == null)|| (root.value%2==1)) return 0; return 1+ countEven(root.left) + countEven(root.right); } this i just coded as i do not have a way to test this out. I'm not able to test it out at the moment but need an answer so badly. any help is deeply appreciated.

    Read the article

  • Reverse wildcard search in codeigniter

    - by Andy Platt
    I am implementing a snippet-based content management system into my current project. Snippets can be associated with a page either by exact match of the full url falling back to a wildcard match on a partial url or finally a default snippet. To implement this I have a created table of page associations with a wildcard flag, the system first checks the current url against the non-wildcard associations and if it doesn't find a match it checks against the partial url's where the wildcard flag is set. In order to achieve this I am getting all the partial url's from the database and putting them into an array then walking the array to check for a match against the current url: protected function _check_wildcard($url = NULL) { if($url) { $q = $this->db->where('wildcard' ,'Y') ->from('content') ->get(); $wildcards = $q->result_array(); foreach($wildcards AS $wildcard) { if(strpos($url,$wildcard['url']) > 0) { return $wildcard['snipppet_id']; } } } else { return NULL; } } Can anyone suggest a better way to do this - preferably one that doesn't involve having to constantly download the full list of all the wildcards each time I load a page as I am afraid that this will have a negative effect on the scalability of the system down the line?

    Read the article

< Previous Page | 214 215 216 217 218 219 220 221 222 223 224 225  | Next Page >