search

How to sort mysql coloumn that has data in Bytes KB MB GB?

一曲冷凌霜 提交于 2019-12-24 00:39:55
问题 I have a table with column 'size' that has file sizes in diff units like '10 Kb', '50 MB', '1 GB'. The problem is when I try to sort, it returns 1 GB row at first. How to solve this prob without changing old data ??? Any help is much appreciated... Thanks. 回答1: You should really either convert all data into a common unit (say bytes) or add a column which contains a "unit of measure" and keep the size column itself numeric. Having said that, the following should work on data in that ends with

YouTube UITableView from a search query using GData

妖精的绣舞 提交于 2019-12-24 00:37:45
问题 I'm trying to customize a table view to display a feed of youtube videos based on a search query. I found this code http://pastebin.com/vmV2c0HT which displays a feed of a YouTube channel in a tableview, it works fine. However, when modifying the viewDidLoad function to search for a query instead of a user feed, I always end up with a blank table view. Here is my viewDidLoad function: - (void)viewDidLoad { GDataServiceGoogleYouTube *service = [self youTubeService]; NSString *searchString = @

Select Command with Multiple LIKEs

╄→гoц情女王★ 提交于 2019-12-24 00:32:46
问题 Functionality User inputs text into textboxA. Search the database records for First Names AND Last Names corresponding to the user's input. The Problem: It appears the results I am getting are only searching "First Name" field and not BOTH the First Name and Last Name Fields Example: * A search for "Mike" returns: * Mike Smith Mike Jones A search for "Jones": Mike Jones is not returned CODE: Protected Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click If

Efficient search in datastructure ArrayList

柔情痞子 提交于 2019-12-24 00:09:29
问题 I've an ArrayList which contains my nodes. A node has a source, target and costs. Now I have to iterate over the whole ArrayList. That lasts for for over 1000 nodes a while. Therefore I tried to sort my List by source. But to find the corresponding pair in the List I tried the binary search. Unfortunately that works only if I want to compare either source or target. But I have to compare both to get the right pair. Is there another possibility to search an ArrayList efficient? 回答1:

Search a string/text from a PDF file and list all the matched string in iPhone/iPad application

旧时模样 提交于 2019-12-23 23:43:18
问题 I have implemented an iPad application which is actually read the PDF file(using quartz). Now I want to implement the Search Feature and for this I have checked some tutorial some where mentioned using quartz and some where mentioned FastPdfKit. But I don't know which one will be better. I have seen the quartz ( https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf_scan/dq_pdf_scan.html ). I have some doubt in this. the "Callbacks for

Different lucene search results using different search space size

拟墨画扇 提交于 2019-12-23 23:22:03
问题 I have an application that uses lucene for searching. The search space are in the thousands. Searching against these thousands, I get only a few results, around 20 (which is ok and expected). However, when I reduce my search space to just those 20 entries (i.e. I indexed only those 20 entries and disregard everything else...so that development would be easier), I get the same 20 results but in different order (and scoring). I tried disabling the norm factors via Field#setOmitNorms(true), but

Yii2-Use SqlDataProvider with GridView and enable Gridview Filter for search

孤街醉人 提交于 2019-12-23 22:22:09
问题 I am working on yii2 . I have a custom view in which I have placed to views DetailView and GridView . Below is my controller code public function actionViewcreated($id)// passed the id of my model which is created in the previous step { $model=$this->findModel($id); // this will find my model/record based on the id $sub_div = $model->sub_div; $meter_type = $model->meter_type; $query = "SELECT DISTINCT m.`id` AS meter_id, ins.`meter_msn` AS Meter_Serial_Number, ins.`meter_type` AS Meter_Type,

Yii: HAS_MANY search

梦想的初衷 提交于 2019-12-23 22:07:35
问题 I have the following tables: user (id, cv_personal_data_id), cv_personal_data (id, firstname, surname, gender, address, ...), cv_laboral_exp (id, user_id, position, seniority,... ), cv_study (id, user_id, name, institution, average, ...), cv_language (id, user_id, language_name, writing_level, ...) In my User model I have defined the following relations: public function relations() { return array( 'cvLaboralExps' => array(self::HAS_MANY, 'CvLaboralExp', 'user_id'), 'cvLanguages' => array(self

Search Feature using .Contains with terms within a one field

雨燕双飞 提交于 2019-12-23 20:42:24
问题 I have built a search feature for a product site. The search works fine. Recently, we have added a SearchTerm field in the database. SearchTerm Data example: "work shoes blue black gear" Current code is pM = (from p in ctx.Products where p.productSearchField.Contains(term) || p.productName.Contains(term) select p).ToList() If the term = "shoes" <-- works If the term = "work shoes" <-- works If the term = "black shoes" <-- does NOT work. I also tried to separate the SearchTerm Data by commas,

how to structure data for searchability

五迷三道 提交于 2019-12-23 20:29:10
问题 I am writing a search application specifically for music playlists. The genre and file format differs from playlist to playlist, and sometimes within the playlist there are differences too. There is also a concept of "synonymous" tags (e.g. urban would cover both hiphop and r&b, but not the other way around). Below is a list of search terms and my expected results. gospel: should return all playlists with at least one gospel song. playlists with all gospel songs would be shown first. urban: