Is it possible to override the to_sentence method just for one model in my rails application?
More generally, how do I modify methods for an Array of my models?
Hi,
I have resize images exceeding a max size. Methods I tried so far are not good enough :-(
System.Drawing.Image.GetThumbnailImage generates very poor quality images in general.
Playing with options like this one I can generate better images in quality but heavier than the original one.
Probably the second option (or something similar) is the best option and I would need to resize using the proper options.
Any advice?
Hi dudes,
i'm starting to implement AdWhirl in my application. i follow the instructions which is belong to adwhirl but i cant see any ad in my application.i add the following methods in my viewcontroller class
- (void)viewDidLoad {
[super viewDidLoad];
AdWhirlView *adView=[AdWhirlView requestAdWhirlViewWithDelegate:self];
[self.view addSubview:adView];
}
-(NSString *) adWhirlApplicationKey{
return @"myAdWhirlKey";
}
-(UIViewController *) viewControllerForPresentingModalView{
return self;
}
i doesn't display anything. please help how to implement AdWhirl
Hi,
I have preperd a remote service, i would like to know if it's possible somehow via this service to call another activities?
coz usually what ive seen so far, is how external apps calling the remote service and using it's methods, but i want vice versa.. that the remote service will call an external app's activity,
thanks,
moshik.
From what I gather, there are two major methods to perform alignment on point clouds, Iterative Closest Point (ICP) and Particle Filtering. What are the advantages of each method? And can someone point me some good tutorials.
For what I am currently doing, I think ICP would be easier, I can't seem to find any simple reference implementations online for 2d point sets. Has anyone seen (psuedo)code for ICP with details on the transformation step?
Thanks in advance.
Well i have a WCF service and has to methods one that gives a list of a object and one that gives a list of objects..
the object returned from method one is part of the list from method two.
Im using wpf and binding a combo box to the two the results..
but the problem is that the combo box dosent know how to compare the objects as WCF did not generate this for me.. is there some way to fix this??
I'm using GitHub for code and Heroku for the deployment platform for my rails app.
I don't want to have sensitive data under Git. Such data include database file settings (database.yml) and some other files that have secret API keys.
When I deploy to heroku, how can I deal with files that are not under revision control.
When I use Capistrano, I can write some hook methods, but I don't know what to do with Heroku.
Hi Guys,
I need a help from ur side.
Actually I need to call a method automatically when I click on to the textview.
Is there any delegate methods or any other process for this.
Anyone's help will be much appreciated.
Thank you,
Monish.
I woudl like to know how to use a System.Collections.Hashtable in F#. The reason it is a Hashtable is because I am referencing C# assemblies.
How would I call the following methods?
- Add
- Get value from key
I have not been able to find anything useful in google about this. Any help would be appreciated.
Thanks
I've seen developers use various methods to prevent spam on a basic html contact form
Method 1 is where the developer uses a Captcha image and Method 2 where only a Question is asked eg. Are you Human? with a radio button.
Which one is the better one to use and why?
I am fiddling around with JBOSS's Web Services, and I have created the following:
http://127.0.0.1:8080/IM/TestService?wsdl
Now I need to access Web Methods from that Web Service from JavaScript.
Say I have a web method named foo in TestService, how do I make an ajax call to it?
I tried accessing the method via http://127.0.0.1:8080/IM/TestService/foo, but I'm getting an HTTP Status 404.
I'm trying to get jQuery to play a sound on element hover/click. (It's like a flash website without flash)
I've tried the methods recommended in Cross-platform, cross-browser way to play sound from Javascript?, the jQuery Sound plugin and a couple of other tutorials without any success. I'm assuming this is because they haven't been updated since 2008.
Does anyone have any recommendations?
I'm using nginx as a reverse proxy with an Apache back-end handling some PHP files.
The files return the right expiry headers and proxy_cache does a good job of caching them, but I've noticed that the cached content returns a 200 on every refresh, when it might be more efficient to return a 304 on the cached files.
The files in question are generated by PHP. The urls do not have .php in them as they've been prettified.
Any idea why nginx might not be returning 304 on repeated visits to a cached PHP output?
To clarify: It's using proxy_cache for caching dynamic PHP pages (not static html pages generated by PHP). I'm setting expires headers in the PHP file of time + 24 hours. With that in mind, I was hoping nginx would be able to then return 304s on its cached versions during that 24 hour window.
I recently ran across several objects implemented to handle events with a hard coded mapping using this pattern:
public void handleEvent(Event event)
{
if(event.getCode() == SOME_STATIC_EVENT)
doSomething(event);
if(event.getCode() == ANOTHER_STATIC_EVENT)
doSomethingElse(event);
}
where doSomething functions are implemented as methods of the same class.
In hopes of striving for looser coupling, how would you suggest abstracting out this pattern? Also, what's the best approach for mapping 0..N functions to a fired event?
MSDN says that you should use structs when you need lightweight objects. Are there any other scenarios when a struct is preferable over a class?
Edit:
Some people have forgotten that:
1. structs can have methods!
2. structs have no inheritance capabilites.
Another Edit:
I understand the technical differences, I just don't have a good feel for WHEN to use a struct.
I need to divide a scene in to two layers. So that I can write same methods for two layers.
So I may get two functionalities. But can I make that ? Is there a possibility in cocos2d?
Thank You
Is there a framework or a native way in .net to dynamically generate wrappers for specified interface. I need a way to say, here is a type I have and here is the interface I want to wrap around it, and for each method it the interface forward calls to these methods on the type provided.
How do I get the request object from inside the bootstrap file?
I can try this methods but not work.
$request= new Zend_Controller_Request_Http();
$reuqest = Zend_Controller_FrontController::getInstance()->getRequest();
I have this list
http://pastebin.me/dde64f8c185de9dd5e429f84701a01ce
Anytime you click on an image extra content appears . I have tryed several css methods but i cant get the images to remain in their position and get the text to go underneath . Anyone has a solution ?
Is there any difference between these two methods of moving a file?
System.IO.FileInfo f = new System.IO.FileInfo(@"c:\foo.txt");
f.MoveTo(@"c:\bar.txt");
//vs
System.IO.File.Move(@"c:\foo.txt", @"c:\bar.txt");
I am doing some input/output between a c++ and a python program (only floating point values) python has a nice feature of converting floating point values to hex-numbers and back as you can see in this link:
http://docs.python.org/library/stdtypes.html#additional-methods-on-float
Is there an easy way in C++ to to something similar? and convert the python output back to C++ double/float? This way I would not have the problem of rounding errors when exchanging data between the two processes...
thx for the answers!
Let us suppose i have these three methods defined:
int F1(int, int);
int F1(float, float);
Float F1(int, int);
and i am calling method F1 here:
Console.writeline(F1(5,6).ToString()));
Which method it will call and why?
I have a big table with vertical scroll bar.
I would like to scroll to a specific line in this table using jQuery/Javascript.
Should I look for plug-ins for this task, or there are built-in methods ?
Here is a little example to play with.
Thanks a lot !