named

Named constructor and inheritance

I'm working on C++ framework and would like to apply automatic memory management to a number of core classes. So far, I have the standard approach which is class Foo { public: static shared_ptr<Foo> init() { return shared_ptr<Foo>(new Foo); } ~Foo() { } protected: Foo() { } }; // Example of use shared_...

How to capture output of execvp

I'm developing a program which executes a program using execvp. It needs to capture the results of the child process and parse them in the main process. It seems there is a way, using named pipes, and duping. I'm trying to hunt down a good example of this, but so far no luck. If anyone has any pointers, links and/or suggestions about thi...

How to guarantee read() actually sends 100% of data sent by write() through named pipes

I've got the following two programs, one acting as a reader and the other as a writer. The writer seems to only send about 3/4 of the data correctly to be read by the reader. Is there any way to guarantee that all the data is being sent? I think I've got it set up so that it reads and writes reliably, but it still seems to miss 1/4 of th...

Delete URL for nested associations

Hi guys, I'm having the following many to many relationship in Rails (ActiveResource, of course): class User < ... has_many :channel_assignments has_many :channels, :through => :channel_assignments end class Channel < ... has_many :channel_assignments has_many :users :through => :channel_assignments end class ChannelAssignme...

PHP regex extract/replace values from xml-like tags via named (sub)groups

Trying to create a simple text-translator in PHP. It shoult match something like: Bla bla {translator id="TEST" language="de"/} The language can be optional Blabla <translator id="TEST"/> Here is the code: $result = preg_replace_callback( '#{translator(\s+(?\'attribute\'\w+)="(?\'value\'\w+)")+/}#i', array($this, 'translateTe...

Nested Resource at Root Level of Path

I'm trying to create a nested resource with a url scheme along the lines of: "http://example.com/username/...". What I currently have is this: ActionController::Routing::Routes.draw do |map| map.home '/', :controller => 'home' map.resource :session map.resources :users, :has_many => :nodes #map.user '/:id', :co...

Win32 Sockets vs. Named Pipes

Is it possible to use sockets on win32 and and not have the firewall possibly block the port you are using? Something like with unix wwere you have IF_UNIX instead of IF_INET ( named pipes instead of sockets ). I dont want to use named pipes on win32 since they are just so unreliable. ...

named and default arguments

In PHP, I have to pass the arguments in the same order as the arguments are in the constructor. Now, in Python, take listbox = Listbox(root, yscrollcommand=scrollbar.set) for example. If I had passed yscrollcommand=scrollbar.set as the third argument and yscrollcommand was the second argument in the constructor, would I still be abl...

Hibernate named query parameter

Hi, I am having problem with named query parameter. My query is as follow: <sql-query name="getCustomer"> <![CDATA[ select * from customer where customerId=:custId and billId in ( :billIdList ) ]]> </sql-query> I am setting all parameters, but having problem in :billIdList whenever I am setting this parameter I am getting a Empt...

nhibernate named queries , name not found

I'm coming from a Java side of using Hibernate and I just haven't found the proper place to put the named query in NHibernate. Using Visual Studio 2008 , C# 2008 I have a query <query name="SchwabAccountList"> from DB_Accounts a where a.AdminOffCode = 'SWB' </query> and I want to put it in the .hbm.xml for the Account table (DB...

rails named_scope and :source

I am a beginner in Rails, Can we use :source with named scope? I am able to use it with has_many and other associations Thanks Mark ...

XAML: Can I refer to a Grid row or column by name?

If I name each row and column in a grid, can I set a control's grid.row="Row_Top"? I have defined StaticResources to refer to it but is there a converter or some other method to accomplish this without the resource? ...

Rails, routing many named routes to one action

Is there a simpler way of writing this: map.old_site_cusom_packages '/customs_packages_options.html', :controller => :public, :action => :redirect_to_home map.old_corporate '/corporate.html', :controller => :public, :action => :redirect_to_home map.old_track '/track.html', :controller => :public, :action => :redirect_to_home map...

NHibernate Named Query

Hi, I'm trying to learn about SQL named queries using NHibernate and I have the following code. The issue is that I get the following error : "Message: No value given for one or more required parameters." when I try to test the code from MBUnit. <?xml version="1.0" encoding="utf-8"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2...

Using named pipe to communicate between unicode and non-unicode processes on windows.

If a process with unicode enabled creates a named pipe, it must pass a LPCTSTR for the pipe name, in this case a LPCWSTR. Will a second process wihtout unicode be able to open that pipe by passing a LPCSTR for the pipe name? Also, can I call CreateNamedPipeW or CreateNamedPipeA and ignore whether unicode is enabled, or do I have to call...

Registering a Named Function as a Listener with Jquery

I'm new to javascript/jquery and I've done some poking around the web, but I can't figure out why the following is invalid: var toggleSection = function(sectionName) { // Do some Jquery work to toggle stuff based on sectionName string // (concatenate sectionName with other text to form selectors) }; $('#togglecont1').click(toggleSection...

Are Hibernate named HQL queries (in annotations) optimised?

A new colleague has just suggested using named HQL queries in Hibernate with annotations (i.e. @NamedQuery) instead of embedding HQL in our XxxxRepository classes. What I'd like to know is whether using the annotation provides any advantage except for centralising quueries? In particular, is there some performances gain, for instance ...

Python Wildcard Import Vs Named Import

Ok, I have some rather odd behavior in one of my Projects and I'm hoping someone can tell me why. My file structure looks like this: MainApp.py res/ __init__.py elements/ __init__.py MainFrame.py Inside of MainFrame.py I've defined a class named RPMWindow which extends wx.Frame. In MainApp.py this works: from res.elemen...

RNDC fails: permission denied

Named works great. It creates a pid in /var/run/named/named.pid as expected. It is listening on port 953 as shown by the log: Apr 20 14:42:38 guchuko named[9115]: command channel listening on 127.0.0.1#953 But whenever I try to run "rndc reload" I get: rndc: 'reload' failed: permission denied What file is it being denied permission to ?...

Inter Process communication: MFC server, .NET C# client

Hi guys, I have two MFC C++ desktop applications exchanging string commands using named pipes. All good and reliable. Now, I have to add clients that are written in .NET C# using SilverLight controls. I know how to do named pipes in C#. But my first attempt to mix those failed: cannot connect clients to running servers. Is there an...