» Home » named » Page 1
How to make a complex named scope play nice with associations and other named scopes [rails]
Category : Databases

I have the following named scope on

class RentableItem < ActiveRecord::Base
named_scope :available_at, lambda{ |starts_at, ends_at| {
:select => "t.*",
:from => "(SELECT ri.*, COALESCE(c1.start_date, '#{starts_at}') AS EarliestAvailable,
COALESCE(c2.end_date, '#{ends_at}') AS LatestAvailable

View Replies

Rails 3 Named Routes - Calling different actions in the controller dynamically as a parameter with the same named route
Category : Web Design

Say i have a controller with index and doesn't have any other RESTful actions. I want to call different actions as a parametr from the same controller which has a named route as follows.


I have TargetsController and i should be able to call

targets_path(any_action, params)

Can i call

resources :targets do

View Replies

Paste named range from Excel to Powerpoint into named shape - VBA
Category : Programming Languages

I want to build a macro that connects our Excel-Data-Sheet with our Reporting-Powerpoint-Presentation.
So I have this named Range ("A") selected and copied.
Then I want to paste the data into a shape in Powerpoint which has the same name as my Range ("A").

Sub SyncWithPPT()
Dim pptApp As PowerPoint.Application
Dim pptPres As PowerPoint.Presentation
Dim p

View Replies

Django: Named URLs / Same Template, Different Named URL
Category : Programming Languages

I have a webapp that lists all of my artists, albums and songs when the appropriate link is clicked. I make extensive use of generic views (object_list/detail) and named urls but I am coming across an annoyance. I have three templates that pretty much output the exact same html that look just like this:

{% extends "base.html" %}
{% block content %}
<div id="content

View Replies

Can I force a program to load a weakly-named assembly when it's linked to a strongly-named assembly?
Category : Programming Languages

I have a program that references a strongly named assembly which is in the gac. I have a debug build of this assembly which I want to debug into, but it isn't strongly named. Can I use a policy file or something to force the program to use the weakly named assembly? Or do I have to recompile the program to reference the weakly named assembly? (These assembles are purchased from a 3rd-party.

View Replies

Javascript: Inconsistency when assigning a named function to a variable (named function expression)
Category : Development Tools & Services

Can anyone explain the difference in behaviour between Internet Explorer and Firefox in regards to the below:

var myNamespace = (function () {
var exposed = {};
exposed.myFunction = function myFunction () {
return "Works!";
// IE: "Works!"
// Firefox: ReferenceError: myFunction is not defined

View Replies

Named-pipe Error: Unable to create named pipe w/err 0x0000007b
Category : Programming Languages

Unable to create named pipe w/err 0x0000007b

I am getting the above error when I try to connect the server and client on different machines.

The code I got from MSDN Link: http://code.msdn.microsoft.com/windowsdesktop/CppNamedPipeCommunication-7447a0bf

I am using Windows 7 machines to communicate.

#define FULL_PIPE_NAME L".pipeSamplePipe"

View Replies

“Named query not known” for named Hibernate query?
Category : Programming Languages

What might be the problem?

@NamedQueries( {
@NamedQuery(name = User.ALL,
query = "SELECT u FROM User u")
public class User {
public static final String ALL = "User.all";
public class Service {
find... with ... User.ALL


Caused by: org.hiberna

View Replies

Parsing a number of named sets of other named sets
Category : Programming Languages

So I want to write a... well... not-so-simple parser with boost::spirit::qi. I know the bare basics of boost spirit, having gotten acquainted with it for the first time in the past couple of hours.

Basically I need to parse this:

# comment
# other comment
set "Myset A"
figure "AF 1"
i 0 0 0
i 1 2 5

View Replies

How can I have output from one named pipe fed back into another named pipe?
Category : Network & Servers

I'm adding some custom logging functionality to a bash script, and can't figure out why it won't take the output from one named pipe and feed it back into another named pipe.

Here is a basic version of the script (http://pastebin.com/RMt1FYPc):

PROGNAME=$(basename $(readlink -f $0))

View Replies

2012 / 2017 Copyrights BigHow , All Rights Reserved .