Search Results

Search found 509 results on 21 pages for 'ar'.

Page 10/21 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to skip callbacks on Mongoid Documents?

    - by jpemberthy
    My question is similar to this one http://stackoverflow.com/questions/1342761/how-to-skip-activerecord-callbacks but instead of AR I'm using Mongoid, It seems like that isn't implemented yet in the current version of Mongoid, so I'd like to know what should be an elegant solution to implement it. (if necessary).

    Read the article

  • searchlogic and virtual attributes

    - by Ermin
    Let's say I have the following model: Person <AR def name [self.first_name,self.middle_name,self.last_name].select{|n| n.present?}.join(' ') end end How could I do a search on the virtual attribute with searchlogic, something like: Person.search.name_like 'foo' Of courese I could construct a large statement like: Person.search.first_name_like_or_last_name_like_or_... 'argh' but surely there is a more elegant way.

    Read the article

  • Fail2Ban - Log to mysql

    - by user319660
    Hi! We have a few servers with SSH public (using sFTP). Obviously, the attacks ar too many. We want put the banned logs into a MySQL DB for make stats and etc. Have anyone tryied this? Thanks

    Read the article

  • Assembly language 8086

    - by rkrahu
    I v porblem in assembly 8086, I can't use 2D array when I m using like this mov ar[cx][dx] then arising error and when I want to us SI and DI both in arrary then also find error. I need answer quickly thanks for your help

    Read the article

  • getting the request.files count as 0 in mvc???????

    - by Ritz
    hello all, please help me when i am uploading a particu;ar file in mvc and i am requesting the file using request.files in the controller i am getting the count as 0 please tell me where i am missing.i am using asp.net + mvc. i have used a simple file upload control of html. please help me,its urgent Thanks Ritz

    Read the article

  • Website doesn't work during Uploading of crucial files

    - by Ali
    HI guys - I have a problem with maintenance of my php based website. My website is built on the Zend Framework. When I wish to upload a new copy or version online - during the time of upload especially when crucial files like models and controllers ar ebeing uploaded and rewritten - the site won't run understandably. Is there a way to upload a website without having to go through this issue?

    Read the article

  • How to convert attribute name to string?

    - by Acidburn2k
    Lets say we have some basic AR model. class User < ActiveRecord::Base attr_accessible :firstname, :lastname, :email end ... some_helper_method(attrib) ... def Now I would like to pass someuser.firstname to helper and I would like to get both the value and the attribute name, for example: some_helper_method(someuser.firstname) > "firstname: Joe" some_helper_method(someuser.lastname) > "lastname: Doe"

    Read the article

  • ffmpeg libxvid settings for optimal quality and preferably fast encoding

    - by dropson
    What ffmpeg settings should I use to convert a video into xvid with a mixed speed and quality ratio, using 2-passes, and alternativly 1 pass. Currently I use the following for just 1 pass, but I need a better sugestion. -acodec libmp3lame -ab 128 -ar 44100 -ac 2 -vcodec libxvid -qmin 3 -qmax 5 -mbd 2 -bf 2 -flags +4mv -trellis -aic -cmp 2 -subcmp 2 -g 2 -maxrate 1300 -b 1200 -threads 0

    Read the article

  • Generic Rails Route Representation?

    - by Flemish Bee Cycle
    Given one or more instances of a model (AR or DM, whatever). Is it possible to generate the route in the requirement form, by which I mean "/foos/:id" Given the route: resource :foo do resource :bar end generate_route_method [@foo,@bar] - "/foos/:id/bars/:id" I'm not talking about #foos_path or #polymorphic_path, rather, literally generating the string containing the wildcard components (i.e ":id"), the same as it would appear as if you did "rake routes".

    Read the article

  • django internationalisation loading error

    - by ha22109
    Hello All, I m not able to change the locale of django -admin when i switch to different locale from browser.But if i mention in my settings.py the language code then it is working but browser locale doesnot have any impact on it #setting.py LANGUAGES = ( ('ar', gettext_noop('Arabic')), ('ja', gettext_noop('japanese')), ('bg', gettext_noop('Bulgarian')), LANGUAGE_CODE = ''# LANGUAGE_COOKIE_NAME = 'django_language' LOCALE_PATHS = ()

    Read the article

  • how to use time out in mplayer?

    - by manoj
    I am trying to save audio using mplayer from a live http stream. saving audio is successful. If there is no live stream playing it does not exit automatically. Is there any way to set timeout if there is no live stream? code : mplayer -i url -t 00:00:10 -acodec libmp3lame -ab 24 -ar 8000 audio.mp3 Thanks in advance.

    Read the article

  • Checking ActiveRecord Associations in RSpec.

    - by alokswain
    I am learning how to write test cases using Rspec. I have a simple Post Comments Scaffold where a Post can have many Comments. I am testing this using Rspec. How should i go about checking for Post :has_many :comments. Should I stub Post.comments method and then check this with by returning a mock object of array of comment objects? Is testing for AR associations really required ?

    Read the article

  • rails include with options

    - by holden
    Is it possible to limit an AR :include to say only pull in one record... Item.find(:all, :include => [ :external_ratings, :photos => LIMIT 1 ]) I have a list of items and each item has between 5 and 15 photos. I want to load a photo id into memory, but i don't need all of them, I just want to preview the first one. Is there a way to do this?

    Read the article

  • Make LLVM inline a function from a library

    - by capitrane
    I am trying to make LLVM inline a function from a library. I have LLVM bitcode files (manually generated) that I linked together with llvm-link, I also have a library (written in C) compiled into bitcode by clang and archived with llvm-ar. I manage to link everything together and to execute but i can't manage to get LLVM to inline a function from the library. Any clue about how this should be done?

    Read the article

  • Override as_json or to_json model class name

    - by Jack
    I'd like to modify the classname when calling to_json on an AR model. i.e. Book.first.to_json #=> "{\"book\":{\"created_at\":\"2010-03-23 Book.first.to_json(:root => 'libro') #=> "{\"libro\":{\"created_at\":\"2010-03-23 Is there an option to do this?

    Read the article

  • Use multiple inheritance to discriminate useage roles?

    - by Arne
    Hi fellows, it's my flight simulation application again. I am leaving the mere prototyping phase now and start fleshing out the software design now. At least I try.. Each of the aircraft in the simulation have got a flight plan associated to them, the exact nature of which is of no interest for this question. Sufficient to say that the operator way edit the flight plan while the simulation is running. The aircraft model most of the time only needs to read-acess the flight plan object which at first thought calls for simply passing a const reference. But ocassionally the aircraft will need to call AdvanceActiveWayPoint() to indicate a way point has been reached. This will affect the Iterator returned by function ActiveWayPoint(). This implies that the aircraft model indeed needs a non-const reference which in turn would also expose functions like AppendWayPoint() to the aircraft model. I would like to avoid this because I would like to enforce the useage rule described above at compile time. Note that class WayPointIter is equivalent to a STL const iterator, that is the way point can not be mutated by the iterator. class FlightPlan { public: void AppendWayPoint(const WayPointIter& at, WayPoint new_wp); void ReplaceWayPoint(const WayPointIter& ar, WayPoint new_wp); void RemoveWayPoint(WayPointIter at); (...) WayPointIter First() const; WayPointIter Last() const; WayPointIter Active() const; void AdvanceActiveWayPoint() const; (...) }; My idea to overcome the issue is this: define an abstract interface class for each usage role and inherit FlightPlan from both. Each user then only gets passed a reference of the appropriate useage role. class IFlightPlanActiveWayPoint { public: WayPointIter Active() const =0; void AdvanceActiveWayPoint() const =0; }; class IFlightPlanEditable { public: void AppendWayPoint(const WayPointIter& at, WayPoint new_wp); void ReplaceWayPoint(const WayPointIter& ar, WayPoint new_wp); void RemoveWayPoint(WayPointIter at); (...) }; Thus the declaration of FlightPlan would only need to be changed to: class FlightPlan : public IFlightPlanActiveWayPoint, IFlightPlanEditable { (...) }; What do you think? Are there any cavecats I might be missing? Is this design clear or should I come up with somethink different for the sake of clarity? Alternatively I could also define a special ActiveWayPoint class which would contain the function AdvanceActiveWayPoint() but feel that this might be unnecessary. Thanks in advance!

    Read the article

  • could not read symbols: Archive has no index; run ranlib to add one

    - by indu
    i tried making library with ar -r -c -s libtestlib.a *.o as given in this tutorial http://matrixprogramming.com/Tools/CompileLink.html But on linking with library following error comes g++ -o uni2asc uni2asc.o -L../Modules -ltestlib ../Modules/libtestlib.a: could not read symbols: Archive has no index; run ranlib to add one collect2: ld returned 1 exit status i tried with ranlib also but still the error comes.. im working with ubuntu9.10 Please suggest me some solution for this

    Read the article

  • How to define schema for an ActiveRecord model?

    - by Eric Stanton
    I can find how to define columns only when doing migrations. However i do not need to migrate my model. I want to work with it "virtually". Does AR read columns data only from db? Any way to define columns like in DataMapper? class Post include DataMapper::Resource property :id, Serial property :title, String property :published, Boolean end Now i can play with my model without migrations/connections.

    Read the article

  • Where to initialize a NSMutableArray?

    - by eco_bach
    Hi having an issue using a NSMutableArray; In my implementation file applicationDidFinishLaunching method I have _imgArray = [NSMutableArray array]; and _imgArray is defined in my .h file as NSMutableArray *_imgArray; After populating it, it traces out correctly. The problem is, in another method in my implementation file, I can't seem to acces the _imgArray array. It traces out to _imgArray= ar.lproj What gives?

    Read the article

  • Adding a LIKE criteria to a Rails Conditions block

    - by Neil Middleton
    Consider the following code which is to be thrown at an AR find: conditions = [] conditions[:age] = params[:age] if params[:age].present? conditions[:gender] = params[:gender] if params[:gender].present? I need to add another condition which is a LIKE criteria on a 'profile' attribute. How can I do this, as obviously a LIKE is usually done via an array, not a hash key.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >