Search Results

Search found 4088 results on 164 pages for 'params keyword'.

Page 60/164 | < Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >

  • HQL - row identifier for pagination

    - by anna.ruk
    Does anyone know if HQL has a keyword to identify rows such as ROWID or ROWNUM? I would like to implement pagination with HQL but I am not able to use .setMaxResult() or .setFirstResult() because I don't work with the session object directly and therefore don't use the Query object but simply create my query as a string and use the .find() method. I tried using LIMIT and OFFSET in my query, but HQL seems to be ignoring these keywords and is returning the whole result to me no matter what. I'm also not able to use Hibernate criteria because it does not have support for the "HAVING" clause that appears in my query. My last resort is to restrict the result set using the ROWNUM/ROWID keyword. Does anyone else have any other suggestions?

    Read the article

  • IOS restkit error

    - by user1302602
    I am sending a Post with object loader and getting this error in output window. FYI, My didFailWithError: delegate never got hit. Not sure why. `objectLoader:didFailWithError:]:` unrecognized selector `sent to class 0x123608` How did i find out what is 0x123608? I set the router in AppDelegate class and Mapping in AppDelegate too. here is a method in my class which inherit RKObjectLoaderDelegate. I am using shared singleton. [[RKObjectManager sharedManager] postObject:review usingBlock:^(RKObjectLoader *loader){ // loader.params=params, loader.objectMapping = [[RKObjectManager sharedManager].mappingProvider objectMappingForClass:[myclass class]]; loader.serializationMIMEType = RKMIMETypeJSON; // We want to send this request as JSON loader.method = RKRequestMethodPOST; loader.serializationMapping = [RKObjectMapping serializationMappingUsingBlock:^(RKObjectMapping* mapping) { [mapping mapAttributes:@"field1", @"field2",@"field3",nil]; }]; loader.targetObject = nil; loader.delegate = self; }]; }

    Read the article

  • Android on TabHost little more depth of the problem, there is the hard return key on the treatment.

    - by user365723
    Hello everybody, I have a question on the Android Activity, for example I have a TabHost, and there are included four Activities, the first tab is a search Activity, enter a keyword in the current result of this Activity to return, and in the current Activity display. Is called to display the search results themselves. And after searching several times, and then return to key mobile phone keypad, the display is the result of the last search keyword, I want the press back key to return to the last call of the Activity or TabHost. Should I do? By the way, in a tab in the use of Intent calls a Activity, eg: host.addTab (host.newTabSpec ("friend"). setIndicator ("search") . SetContent (new Intent (this, Search.class))); In this Activity in the need to call another Activity, e.g: startActivity (new Intent (this, Other.class)); Also called another Activity displayed on this tab, but not yet jump out of the show. I ask how you can achieve this?

    Read the article

  • Groovy: Sorting Columns in a view: list

    - by Luixv
    I have a Groovy application. I am rendering the view list using the following statement: render (view: 'list', model:[reportingInstanceList: reportingInstanceList, reportingInstanceTotal: i, params: params]) The list.gsp is as follows: The view is rendered but the default sorting is not working. <g:sortableColumn class="tabtitle" property="id" title="Id" titleKey="reporting.id" /> <g:sortableColumn class="tabtitle" property="company" title="Company" titleKey="reporting.company" /> Unfortunately the default sorting (by id, by company, etc) are not working. Any hint why? Thanks a lot in advance. Luis

    Read the article

  • Paperclip + ImageMagick on Windows 7: Image display fails when I add styles to attached_file in mode

    - by Brian Roisentul
    I'm working with Ruby on rails 2.3.8, NetBeans IDE. I've installed paperclip and I could show/save images successfully. Now, I've installed ImageMagick-6.6.2-4-Q16(for windows 7, 64bits). Until that moment, my model looked like this(and worked fine): has_attached_file :photo Now, after installing ImageMagick, when I add the :style line it fails: has_attached_file :photo, :styles => {:thumb => "100x100#", :small => "150x150>", :large => "400x400>" } and it throws the following error message when I try to upload an image: TypeError in ProfilesController#update backtrace must be Array of String The only thing I'm doing in the update action of that controller is the following: @profile.update_attributes(params[:profile]) @profile.update_attribute(:photo, params[:profile][:photo]) I've also installed miniMagick gem(because I read somewhere I had to do it). What am I missing?

    Read the article

  • Need a push in the write direction, to write my first functional test in Rails?

    - by Jason
    Hi, I've read quiet a bit of documentation over the last few days about testing in Rails, I'm sitting down to write my first real test and not 100% sure how to tie what I have learned together to achieve the following functional test (testing a controller) I need to send a GET request to a URL and pass 3 parameters (simple web-service), if the functionality works the keyword "true" is simply returned, otherwise the keyword "false" is returned - its in only value returned & not contained in any , or other tags. The test should assert that if "true" is returned the test is successful. This is probably very simple so apologies for such a non-challenging question. If anyone could point me in the write direction on how I can get started, particularly how I can test the response, I'd be very grateful! Thanks!

    Read the article

  • How do I add to a model when on the Show of another model?

    - by Angela
    I on the Show of "Contacts" and want, from that page, to submit a Comment that is related to the Contact. The way I understand to do it would be: <%= start_form_tag :action => "add_comment", :id => @contact %> <% text_area "comment, "body", "rows" = > 5 %> <br> <%= submit_tag %> <%= end_form_tag %> I would create a method in the Contacts controller: def add_comment Contact.find(params[:id]).comments.create(params[:comment]) end However, I feel there's a better way, but don't know what that is? I learned this on a pretty outdated book. Basically, I want to add a new object belonging to a Model while on the Show of a different Model. Would formtastic help me, and if so, how?

    Read the article

  • How do I create the Controller for a Single Table Inheritance in Rails?

    - by Angela
    I am setting up the Single Table Inheritance, using ContactEvent as the Model that ContactEmail, ContactLetter, and ContactCall will all inherit. But I'm stumped on how to create the routing and the controller. For example, let's say I want to create a new ContactEvent with type Email. I would like a way to do the following: new_contact_event_path(contact, email) This would take the instance from Contact model and from Email model. Inside, I would imagine the contact_event_controller would need to know... @contact_event.type = (params[:email]) # get the type based on what was passed in? @contact_event.event_id = (params[:email]) #get the id for the correct class, in this case Email.id Just not sure how this works....

    Read the article

  • copy child collection to another object

    - by Bogdan
    Hi everyone, I have a one-to-many relationship between Part and Params (a "Part" has many "Params). I'm trying to do something naive like this: Part sourcePart = em.find(Part.class, partIdSource); Part destPart = em.find(Part.class, partIdDest); Collection<Param> paramListSource = sourcePart.getParamList(); destPart.setParamList(paramListSource); Basically I want to copy all the parameters from sourcePart to destPart. Hopefully the persistence provider will automatically set the right foreign keys in the Param table/entity. The above code will obviously not work. Is there any easy way of doing this, or do I have to do create a new collection, then add each Param (creating new Param, setting attributes, etc) ?

    Read the article

  • Why does this symfony code not work?

    - by morpheous
    I am trying to pass parameters from one action (foo) to another (foobar). In action foo, I set the arguments thus: $request->getParameterHolder()->set('arg1', 'alice'); $request->getParameterHolder()->set('arg2', 'bob'); In action foobar, I try to retrieve the params thus: $arg1 = $request->getParameter('arg1'); $arg2 = $request->getParameter('arg2'); $this->forward404Unless($arg1 && $arg2); //always forwarded Note: I am aware that I can save the params into the user session variable - but I dont want to do that. I want to pass them as parameters - any ideas how to get this to work?

    Read the article

  • Need a push in the right direction, to write my first functional test in Rails

    - by Jason
    I've read quiet a bit of documentation over the last few days about testing in Rails, I'm sitting down to write my first real test and not 100% sure how to tie what I have learned together to achieve the following functional test (testing a controller) I need to send a GET request to a URL and pass 3 parameters (simple web-service), if the functionality works the keyword true is simply returned, otherwise the keyword false is returned - its in only value returned & not contained in any <div>, <span> or other tags. The test should assert that if "true" is returned the test is successful. This is probably very simple so apologies for such a non-challenging question. If anyone could point me in the write direction on how I can get started, particularly how I can test the response, I'd be very grateful!

    Read the article

  • Rake migration aborted

    - by user2537714
    I'm running Ruby 2.0.0 and I installed it correctly. Just loaded up a gem 'devise' and as I tried to migrate my database changes, it wouldn't work: $ rake db:migrate rake aborted! attr_accessible is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add protected_attributes to your Gemfile to use old one. Then, following another Stackoverflow post, they recommended installing Bundler. I did that successfully and got this: $ bundle exec rake db:migrate rake aborted! attr_accessible is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add protected_attributes to your Gemfile to use old one. Is anyone up to the challenge to help?

    Read the article

  • Ruby on Rails: restrict file type with Paperclip using a flash uploader

    - by aperture
    I have a pretty basic Paperclip Upload model that is attached to a User model through has_many, and am using Uploadify to do the actual uploading. Flash sends all files with the content type of "application/octet-stream" so using validates_attachment_content_type rejects all files. In my create action, I am able to get the mime-type from the original file name, but only after it's been saved, with: def coerce(params) h = Hash.new h[:upload] = Hash.new h[:upload][:attachment].content_type = MIME::Types.type_for(h[:upload][:attachment].original_filename).to_s ... end and def create diff_params = coerce(params) @upload = Upload.new(diff_params[:upload]) ... end What would be the best way of white listing file types? I am thinking a before_validation method, but I'm not sure how that would work. Any ideas would be welcome.

    Read the article

  • C# - Inserting multiple rows using a stored procedure

    - by user177883
    I have a list of objects, this list contains about 4 million objects. there is a stored proc that takes objects attributes as params , make some lookups and insert them into tables. what s the most efficient way to insert this 4 million objects to db? How i do : -- connect to sql - SQLConnection ... foreach(var item in listofobjects) { SQLCommand sc = ... // assign params sc.ExecuteQuery(); } THis has been really slow. is there a better way to do this?

    Read the article

  • Plotting Tweets from DB in Ruby, grouping by hour.

    - by plotti
    Hey guys I've got a couple of issues with my code. I was wondering that I am plotting the results very ineffectively, since the grouping by hour takes ages the DB is very simple it contains the tweets, created date and username. It is fed by the twitter gardenhose. Thanks for your help ! require 'rubygems' require 'sequel' require 'gnuplot' DB = Sequel.sqlite("volcano.sqlite") tweets = DB[:tweets] def get_values(keyword,tweets) my_tweets = tweets.filter(:text.like("%#{keyword}%")) r = Hash.new start = my_tweets.first[:created_at] my_tweets.each do |t| hour = ((t[:created_at]-start)/3600).round r[hour] == nil ? r[hour] = 1 : r[hour] += 1 end x = [] y = [] r.sort.each do |e| x << e[0] y << e[1] end [x,y] end keywords = ["iceland", "island", "vulkan", "volcano"] values = {} keywords.each do |k| values[k] = get_values(k,tweets) end Gnuplot.open do |gp| Gnuplot::Plot.new(gp) do |plot| plot.terminal "png" plot.output "volcano.png" plot.data = [] values.each do |k,v| plot.data << Gnuplot::DataSet.new([v[0],v[1]]){ |ds| ds.with = "linespoints" ds.title = k } end end end

    Read the article

  • How to parse an uploaded txt file in Rails3

    - by gkaykck
    I have a form which have a file input; <%form_tag '/dboss/newsbsresult' , :remote=>true do %> <input type="file" id="examsendbutton" name="txtsbs"/><br/> <input type="submit" value="Gonder"> <%end%> Here i want the user to select a txt file which i try to parse and use at server, but i cannot catch the uploaded file with this code, def newsbsresult @u = params[:txtsbs] #Or params[:txtsbs].to_s p @u end What is the true way of achieving this?

    Read the article

  • No matter what, I can't get this stupid progress bar to update from a thread!

    - by Synthetix
    I have a Windows app written in C (using gcc/MinGW) that works pretty well except for a few UI problems. One, I simply cannot get the progress bar to update from a thread. In fact, I probably can't get ANY UI stuff to update. Basically, I have a spawned thread that does some processing, and from that thread I attempt to update the progress bar in the main thread. I tried this by using PostMessage() to the main hwnd, but no luck even though I can do other things like open message boxes. However, it's unclear whether the message box is getting called within the thread or on the main thread. Here's some code: //in header/globally accessible HWND wnd; //main application window HWND progress_bar; //progress bar typedef struct { //to pass to thread DWORD mainThreadId; HWND mainHwnd; char *filename; } THREADSTUFF; //callback function LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){ switch(msg){ case WM_CREATE:{ //create progress bar progress_bar = CreateWindowEx( 0, PROGRESS_CLASS, (LPCTSTR)NULL, WS_CHILD | WS_VISIBLE, 79,164,455,15, hwnd, (HMENU)20, NULL, NULL); break; } case WM_COMMAND:{ if(LOWORD(wParam)==2){ //do some processing in a thread //struct of stuff I need to pass to thread THREADSTUFF *threadStuff; threadStuff = (THREADSTUFF*)malloc(sizeof(*threadStuff)); threadStuff->mainThreadId = GetCurrentThreadId(); threadStuff->mainHwnd = hwnd; threadStuff->filename = (void*)&filename; hThread1 = CreateThread(NULL,0,convertFile (LPVOID)threadStuff,0,NULL); }else if(LOWORD(wParam)==5){ //update progress bar MessageBox(hwnd,"I got a message!", "Message", MB_OK | MB_ICONINFORMATION); PostMessage(progress_bar,PBM_STEPIT,0,CLR_DEFAULT); } break; } } } This all seems to work okay. The problem is in the thread: DWORD WINAPI convertFile(LPVOID params){ //get passed params, this works perfectly fine THREADSTUFF *tData = (THREADSTUFF*)params; MessageBox(tData->mainHwnd,tData->filename,"File name",MB_OK | MB_ICONINFORMATION); //yep PostThreadMessage(tData->mainThreadId,WM_COMMAND,5,0); //only shows message PostMessage(tData->mainHwnd,WM_COMMAND,5,0); //only shows message } When I say, "only shows message," that means the MessageBox() function in the callback works, but not the PostMessage() to update the position of the progress bar. What am I missing?

    Read the article

  • Sphinx: change column set for searching in runtime

    - by Fedyashev Nikita
    I use Ultrasphinx gem plugin as a wrapper for accessing Sphinx search daemon. My model declaration: class Foo < ActiveRecord::Base is_indexed :fields => ['content', 'private_notes', 'user_id'] Client code: filters = {} if type == "private" # search only in `content` column filters['user_id'] = current_user.id else # search in `content` and `private_notes` columns end results = Ultrasphinx::Search.new(:query => params[:query], :per_page => 20, :page => params[:page] || 1, :filters => filters) The problem I have now with Ultrasphinx gem(or Sphinx, in general?) is that it does not allow me to change set of fields where to look for matches IN RUNTIME How can I solve this problem?

    Read the article

  • Size of assosiation in Hibernate criteria.

    - by trnl
    Hello guys. I've faced with a problem when querying with Hibernate Criteria in Grails. Take a look: def visitors = Client.withCriteria{ visits{ use ( TimeCategory ) {between('date',date,date+1.month-1)} } sizeGe("visits",params.from) sizeLe("visits",params.to) fetchMode("visits", FM.JOIN) }; I need only those clients, which has number of visits in month between from and to bounds. But now size* restrictions is being applied to all visits. So if client has one visit in this month, and visit in previous month. And if I set from=2, this client will be in result. But it should not be there. Any help is appreciated. Thanks, Vova.

    Read the article

  • Use different Solr Similarity algo for every search

    - by snickernet
    Hi Guys, Is possible in Solr 1.4 to specify which similarity class to use for every search within a single index? Let's say, I got 2 type of search (keyword and brand). For keyword search, I want to use the DefaultSimilarity class. But, for brand search, I want to use my CustomSimilarity class. I've been modifying the schema.xml to specify a single similarity class to use. But, I came to this requirement that I have to use 2 different similarity classes. I'll be glad to here your thoughts on this. Thanks in advance.

    Read the article

  • Rails is not passing the "commit" button parameter

    - by Wayne M
    Reinstalling a Rails app on a new server. Part of the app can fork in one of two directions based on the button the user selects. This part isn't working, and when I look at the log I see the values that I gave the form, execept for the commit portion of the params hash. This seems to be why the app isn't working as expected (since there's nothing in params[:commit], but I have no idea why commit would not be passed in; the request is definitely a POST request, and all of the other parameters are there.

    Read the article

  • How to find the right object in a Rails controller based on two variables?

    - by sscirrus
    Hi everyone, I have a three-table system: Companies, Customers, and Matches. The matches include, for example, private notes that each party makes about the other and some options they can set regarding the other. I have two sets of views centered around Companies and Customers for each party to look at the other and modify their notes and settings. # Customers Controller def show @customer = Customer.find(params[:customer]) @matchings = @candidate.matchings.find... @company = Company.find(params[:company]) end Obviously the @matchings is incomplete. Given that @matchings has fields customer_id and company_id, how do I find the right matching record? Thank you!

    Read the article

  • oracle update procedure problem

    - by murali
    hi, i want to update the following procedure in the oracle table..but it is throwing error CREATE OR REPLACE PROCEDURE update_keywords (aKEYWORD IN VARCHAR2, aCOUNT IN NUMBER) AS BEGIN update searchable_keywords set KEYWORD =:new.aKEYWORD or COUNT =:new.aCOUNT where KEUWORD_ID = : old.KEYWORD_ID; END; this is my procedure, i want to update the keyword & count in the searchable_keywords table with keyword_id(primary key) but it is throwing error as follows... LINE/COL ERROR 3/4 PL/SQL: SQL Statement ignored 4/17 PLS-00049: bad bind variable 'NEW.AKEYWORD' 4/31 PL/SQL: ORA-00933: SQL command not properly ended 4/41 PLS-00049: bad bind variable 'NEW.ACOUNT' can you pls help me slove this problem..thanks

    Read the article

  • C# Count registry keys existing using a partial value

    - by cheeseman
    Microsoft.Win32.RegistryKey registryPath = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Testing"); Microsoft.Win32.RegistryKey entryKey = registryPath.OpenSubKey("Entry Point"); I have a lot of keys in Testing, in the format: "Entry Point 011", "Entry Point 123" - so Entry Point with random numbers after it. Would I be able to search the registryPath variable above and get a count of the number of keys containing the "Entry Point" keyword? Assuming that there are also other keys existing without this keyword. At the moment I have been using a for loop and looping for all possible combinations to get a count of all the keys, checking if the key exists or not, but as there are keys as high as "Entry Point 9000" having a for loop execute 9000 times is very inefficient. for (int i = 0; i <= highestEntryPointValue; i++) { Microsoft.Win32.RegistryKey entryKey = steamApps64.OpenSubKey("Entry Point " + Convert.ToString(i)); if (entryKey != null) { count++; } }

    Read the article

< Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >