Search Results

Search found 7418 results on 297 pages for 'argument passing'.

Page 124/297 | < Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >

  • Connection error with heroku db:push with postgresql

    - by Toby Hede
    I have suddenly started seeing this strange error when trying to push my database to heroku. > heroku db:push Auto-detected local database: postgres://infinity:infinity@localhost/infinity_development?encoding=utf8 Failed to connect to database: Sequel::DatabaseConnectionError -> TypeError wrong argument type String (expected Array) My app works fine - the credentials are all set locally.

    Read the article

  • How to return a single variable from a CUDA kernel function?

    - by Pooya
    I have a CUDA search function which calculate one single variable. How can I return it back. global void G_SearchByNameID(node* Node, long nodeCount, long start,char* dest, long answer){ answer = 2; } cudaMemcpy(h_answer, d_answer, sizeof(long), cudaMemcpyDeviceToHost); cudaFree(d_answer); for both of these lines I get this error: error: argument of type "long" is incompatible with parameter of type "const void *"

    Read the article

  • Python - Polymorphism in wxPython, What's wrong?

    - by Wallter
    I am trying to wright a simple custom button in wx.Python. My code is as follows, an error is thrown on line 19 of my "Custom_Button.py" - What is going on? I can find no help online for this error and have a suspicion that it has to do with the Polymorphism. (As a side note: I am relatively new to python having come from C++ and C# any help on syntax and function of the code would be great! - knowing that, it could be a simple error. thanks!) Error def __init__(self, parent, id=-1, NORM_BMP, PUSH_BMP, MOUSE_OVER_BMP, **kwargs): SyntaxError: non-default argument follows default argument Main.py class MyFrame(wx.Frame): def __init__(self, parent, ID, title): wxFrame.__init__(self, parent, ID, title, wxDefaultPosition, wxSize(400, 400)) self.CreateStatusBar() self.SetStatusText("Program testing custom button overlays") menu = wxMenu() menu.Append(ID_ABOUT, "&About", "More information about this program") menu.AppendSeparator() menu.Append(ID_EXIT, "E&xit", "Terminate the program") menuBar = wxMenuBar() menuBar.Append(menu, "&File"); self.SetMenuBar(menuBar) self.Button1 = Custom_Button(self, parent, -1, "D:/Documents/Python/Normal.bmp", "D:/Documents/Python/Clicked.bmp", "D:/Documents/Python/Over.bmp", "None", wx.Point(200,200), wx.Size(300,100)) EVT_MENU(self, ID_ABOUT, self.OnAbout) EVT_MENU(self, ID_EXIT, self.TimeToQuit) def OnAbout(self, event): dlg = wxMessageDialog(self, "Testing the functions of custom " "buttons using pyDev and wxPython", "About", wxOK | wxICON_INFORMATION) dlg.ShowModal() dlg.Destroy() def TimeToQuit(self, event): self.Close(true) class MyApp(wx.App): def OnInit(self): frame = MyFrame(NULL, -1, "wxPython | Buttons") frame.Show(true) self.SetTopWindow(frame) return true app = MyApp(0) app.MainLoop() Custom Button import wx from wxPython.wx import * class Custom_Button(wx.PyControl): ############################################ ##THE ERROR IS BEING THROWN SOME WHERE IN HERE ## ############################################ # The BMP's Mouse_over_bmp = wx.Bitmap(0) # When the mouse is over Norm_bmp = wx.Bitmap(0) # The normal BMP Push_bmp = wx.Bitmap(0) # The down BMP Pos_bmp = wx.Point(0,0) # The posisition of the button def __init__(self, parent, id=-1, NORM_BMP, PUSH_BMP, MOUSE_OVER_BMP, text="", pos, size, **kwargs): wx.PyControl.__init__(self,parent, id, **kwargs) # Set the BMP's to the ones given in the constructor self.Mouse_over_bmp = wx.Bitmap(MOUSE_OVER_BMP) self.Norm_bmp = wx.Bitmap(NORM_BMP) self.Push_bmp = wx.Bitmap(PUSH_BMP) self.Pos_bmp = pos ############################################ ##THE ERROR IS BEING THROWN SOME WHERE IN HERE ## ############################################ self.Bind(wx.EVT_LEFT_DOWN, self._onMouseDown) self.Bind(wx.EVT_LEFT_UP, self._onMouseUp) self.Bind(wx.EVT_LEAVE_WINDOW, self._onMouseLeave) self.Bind(wx.EVT_ENTER_WINDOW, self._onMouseEnter) self.Bind(wx.EVT_ERASE_BACKGROUND,self._onEraseBackground) self.Bind(wx.EVT_PAINT,self._onPaint) self._mouseIn = self._mouseDown = False def _onMouseEnter(self, event): self._mouseIn = True def _onMouseLeave(self, event): self._mouseIn = False def _onMouseDown(self, event): self._mouseDown = True def _onMouseUp(self, event): self._mouseDown = False self.sendButtonEvent() def sendButtonEvent(self): event = wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, self.GetId()) event.SetInt(0) event.SetEventObject(self) self.GetEventHandler().ProcessEvent(event) def _onEraseBackground(self,event): # reduce flicker pass def _onPaint(self, event): dc = wx.BufferedPaintDC(self) dc.SetFont(self.GetFont()) dc.SetBackground(wx.Brush(self.GetBackgroundColour())) dc.Clear() dc.DrawBitmap(self.Norm_bmp) # draw whatever you want to draw # draw glossy bitmaps e.g. dc.DrawBitmap if self._mouseIn: # If the Mouse is over the button dc.DrawBitmap(self, self.Mouse_over_bmp, self.Pos_bmp, useMask=False) if self._mouseDown: # If the Mouse clicks the button dc.DrawBitmap(self, self.Push_bmp, self.Pos_bmp, useMask=False)

    Read the article

  • Java script button

    - by Deven
    hello friends i am developing button which generate another button and this button also calls function in which its id is passed as argument but i am getting error that id is undifined even i set its id attribute before it is added to ma web page

    Read the article

  • Drupal: Convert taxonomy term name to term id

    - by gigantorTRON
    Using 'taxonomy: term ID' as an argument in one of my Drupal views and I'm having trouble getting it to work correctly. On the views administration page it states, "if using term name, it is generally more efficient to convert it to a term ID and use Taxonomy: Term ID rather than Taxonomy: Term Name." How does one go about converting the term name from a URL into a term ID?

    Read the article

  • DataPager EventArgs

    - by philbrowndotcom
    I'm using a DataPager control in my silverlight application. I have different pagers for different DataGrids and want to use the same event handler for the PageIndexChanged event for all of them. The delegate must take an EventArgs object as an argument. Can I use this object to "get back" to the control from which the event was fired?

    Read the article

  • inheritance from str or int

    - by wiso
    Why I have problem creating a class the inherite from str (or also int) class C(str): def __init__(self, a, b): str.__init__(self,a) self.b = b C("a", "B") TypeError: str() takes at most 1 argument (2 given) tha same appened if I try to use int instead of str, but it works with custom classes. I need to use __new__ instead of __init__? why?

    Read the article

  • Get a list/tuple/dict of the arguments passed to a function?

    - by digitala
    Given the following function: def foo(a, b, c): pass How would one obtain a list/tuple/dict/etc of the arguments passed in, without having to build the structure myself? Specifically, I'm looking for Python's version of JavaScript's arguments keyword or PHP's func_get_args() method. What I'm not looking for is a solution using *args or **kwargs; I need to specify the argument names in the function definition (to ensure they're being passed in) but within the function I want to work with them in a list- or dict-style structure.

    Read the article

  • Injecting the mailer service, got "The service definition 'mailer' does not exist"?

    - by Gremo
    This is the class where the service mailer should be injected: namespace Gremo\SkebbyBundle\Transport; use Swift_Mailer; use Gremo\SkebbyBundle\Message\AbstractSkebbyMessage; class MailerTransport extends AbstractSkebbyTransport { /** * @var \Swift_Mailer */ private $mailer; public function __construct(Swift_Mailer $mailer) { $this->mailer = $mailer; } /** * @param \Gremo\SkebbyBundle\Message\AbstractSkebbyMessage $message * @return void */ public function executeTransport(AbstractSkebbyMessage $message) { /* ... */ } } Service id is gremo_skebby.transport.mailer, placed inside mailer.xml file: <parameters> <parameter key="gremo_skebby.converter.swift_message.class"> Gremo\SkebbyBundle\Converter\SwiftMessageConverter </parameter> <parameter key="gremo_skebby.transport.mailer.class"> Gremo\SkebbyBundle\Transport\MailerTransport </parameter> </parameters> <services> <service id="gremo_skebby.converter.swift_message" class="%gremo_skebby.converter.swift_message.class%" public="false" /> <service id="gremo_skebby.transport.mailer" class="%gremo_skebby.transport.mailer.class%" public="false" parent="gremo_skebby.tranport.abstract_transport"> <argument type="service" id="mailer" /> </service> </services> When i try to inject the gremo_skebby.transport.mailer into another service (an helper) i get: Symfony\Component\DependencyInjection\Exception\InvalidArgumentException : The service definition "mailer" does not exist. That is strange, because command php app/console container:debug shows that the mailer service actually exists: mailer container Swift_Mailer I'm loading mailer.xml file dynamically by the extension: if(in_array($configs['transport'], array('http', 'rest', 'mailer'))) { $loader->load('transport.xml'); $loader->load($configs['transport'] . '.xml'); $container->setAlias('gremo_skebby.transport', 'gremo_skebby.transport.' . $configs['transport']); } $loader->load('skebby.xml'); ... and gremo_skebby.transport service is injected into gremo_skebby.skebby service (skebby.xml): <parameters> <parameter key="gremo_skebby.skebby.class"> Gremo\SkebbyBundle\Skebby </parameter> </parameters> <services> <service id="gremo_skebby.skebby" class="%gremo_skebby.skebby.class%"> <argument type="service" id="gremo_skebby.transport" /> </service> </services> A quick test is giving me the same InvalidArgumentException: public function testSkebbyWithMailerTransport() { $loader = new GremoSkebbyExtension(); $container = new ContainerBuilder(); $config = $this->getEmptyConfiguration(); $loader->load(array($config), $container); $this->assertTrue($container->hasDefinition('gremo_skebby.transport.mailer')); $this->assertTrue($container->hasDefinition('gremo_skebby.skebby')); $this->assertInstanceOf('Gremo\SkebbyBundle\Skebby', $container->get('gremo_skebby.skebby')); }

    Read the article

  • Security of WCF endpoints

    - by Matt
    For the sake of argument, lets say that I've got a basicHttp WCF service. Besides implementing authentication (login/logout methods), what is stopping someone from just cracking open Visual Studio, adding a web reference to my website's service, and then playing playing around with my service? I'm not familiar with a method of stopping someone from doing this. The idea of someone downloading all of my Data/Operation contracts and then start playing around is keeping me up at night, and I like my sleep!

    Read the article

  • struct and arguments

    - by jay
    I am trying to modularize a function that used to add values to multiple structures in one call. Now I want to do one value addition per call, but I am not sure how to make a less specific argument reference. func ( [?] *val ) { }

    Read the article

  • Can I somehow know which replacement is taking place from within a callback of preg_replace_callback

    - by jayarjo
    I'm using preg_replace_callback to substitute particular tokens within the string. But apart from actual token I need to know as well whether that token was first, second or third in a subject string. Is there any way to access that info? I found an argument $count in preg_replace_callback definition (http://php.net/manual/en/function.preg-replace-callback.php), which counts replacements, but I'm not sure if it is accessible from within callback. Any example of the usage in described context?

    Read the article

  • Backslashes in gsub (escaping and backreferencing)

    - by polygenelubricants
    Consider the following snippet: puts 'hello'.gsub(/.+/, '\0 \\0 \\\0 \\\\0') This prints (as seen on ideone.com): hello hello \0 \0 This was very surprising, because I'd expect to see something like this instead: hello \0 \hello \\0 My argument is that \ is an escape character, so you write \\ to get a literal backslash, thus \\0 is a literal backslash \ followed by 0, etc. Obviously this is not how gsub is interpreting it, so can someone explain what's going on? And what do I have to do to get the replacement I want above?

    Read the article

  • jQuery Validation Arguments

    - by Idsa
    jQuery Validation plugin has "element" argument for required rule. I know how to use it for inline functions but what if I want to pass it to out-of-line JS function? I tried this: rules: { startHours: { required: startTimeRequired(element) }, but it didn't work.

    Read the article

  • NoClassDefFoundError when running Netbeans 6.8 application

    - by Malachi
    My application has recently started throwing NoClassDefFoundError errors when I am running my application from within NetBeans. It never used to do this. And when I run this outside of NetBeans using the command line argument that it provides once built, these errors are not produced Is this a bug with Netbeans? I have reinstalled NetBeans as I recently had another that was resolved by reinstalling, however the problem still persists. http://stackoverflow.com/questions/2654892/symbol-error-in-java-application-using-netbeans-6-8-when-adding-a-shared-project Within Netbeans Outside NetBeans

    Read the article

  • How to tell Subversion to display binary files using an external program?

    - by lamcro
    I have some code which, like java, is stored in a binary format, and I have the applications to display and modify this code setup in the Subversion's config file. But when I run svn diff for these file, Subversion prevents me =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream I can still view them, but only with the --force argument Since all the files in the repository are of this binary code, how can I permanently force subversion to open the files for diff or edit mode?

    Read the article

  • Why can't I use resources as ErrorMessage with DataAnnotations?

    - by Jova
    Why can't I do like this? [Required(ErrorMessage = "*")] [RegularExpression("^[a-zA-Z0-9_]*$", ErrorMessage = Resources.RegistrationModel.UsernameError)] public string Username { get; set; } What is the error message telling me? An attribute argument must be a constant expression , typeof expression or array creation expression of an attribute parameter type.

    Read the article

  • Should the PHP community start using more discriptive Exceptions?

    - by fireeyedboy
    I work with Zend Framework a lot and I just took a peek at Kohana, and it strikes me as odd that this is a typical scenario in these frameworks: throw Some_Componenents_Exception( 'invalid argument' ); Where I believe this wouldn't be mouch more useful: throw Some_Components_InvalidArgumentException( 'whatever discription' ); Because it is easier to catch. I suspect, but immediately admit it's prejudiced, that the former practice is common in the PHP community. Should we, the PHP community, start using these descriptive types of expections more?

    Read the article

  • Concatenate String

    - by João Madureira Pires
    Hi there. I have the following javascript function: <script type="text/javascript"> function quickCardRegister_OnCompleteSave() { publishContent('This is a description',#{imagePath},'http://www.lala.com'); } </script> The imagePath variable is populated with value: http://localhost/img/30_w130px.gif I'm having the following script error: missing ) after argument list publishContent('This is a description',http://localhost/img/30_w130px.gif,'http://www.lala.com'); How can i surround http://localhost/img/30_w130px.gif with quotes? Thanks

    Read the article

< Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >