Search Results

Search found 5211 results on 209 pages for 'named'.

Page 7/209 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • RSpec and stubbing parameters for a named scope

    - by Andy Waite
    I'm try to write a spec for a named scope which is date dependent. The spec: it "should return 6 months of documents" do Date.stub!(:today).and_return(Date.new(2005, 03, 03)) doc_1 = Factory.create(:document, :date => '2005-01-01') Document.past_six_months.should == [doc_1] end The named scope in the Document model: named_scope :past_six_months, :conditions => ['date > ? AND date < ?', Date.today - 6.months, Date.today] The spec fails with an empty array, and the query in test.log shows why: SELECT * FROM "documents" WHERE (date > '2009-11-11' AND date < '2010-05-11') i.e. it appears to be ignoring my stubbed Date method. However, if I use a class method instead of a named scope then it passes: def self.past_six_months find(:all, :conditions => ['date > ? AND date < ?', Date.today - 6.months, Date.today]) end I would rather use the named scope approach but I don't understand why it isn't working.

    Read the article

  • Parse multiple named command line parameters

    - by scholzr
    I need to add the ability to a program to accept multiple named parameters when opening the program via the command line. i.e. program.exe /param1=value /param2=value and then be able to utilize these parameters as variables in the program. I have found a couple of ways to accomplish pieces of this, but can't seem to figure out how to put it all together. I have been able to pass one named parameter and recover it using the code below, and while I could duplicate it for every possible named parameter, I know that can't be the preffered way to do this. Dim inputArgument As String = "/input=" Dim inputName As String = "" For Each s As String In My.Application.CommandLineArgs If s.ToLower.StartsWith(inputArgument) Then inputName = s.Remove(0, inputArgument.Length) End If Next Alternatively, I can get multiple unnamed parameters from the command line using My.Application.CommandLineArgs But this requires that the parameters all be passed in the same order/format each time. I need to be able to pass a random subset of parameters each time. Ultimately, what I would like to be able to do, is separate each argument and value, and load it into a multidimentional array for later use. I know that I could find a way to do this by separating the string at the "=" and stripping the "/", but as I am somewhat new to this, I wanted to see if there was a "preffered" way for dealing with multiple named parameters?

    Read the article

  • rails - named scoped help

    - by sameera207
    Hi All, I want to write a named scoped to get a record from its id. Ex: I have a model called Event and its same as doing Event.find(id) (I dont want to use find inside my controller and I want my controller to use a named scoped (for future flexibility)) So I have written a named scoped named_scope :from_id, lambda { |id| {:conditions = ['id= ?', id] } } and I'm calling it from my controller like Event.from_id(id) But my problems is it returns Event object array not only one object Ex: if I want to get event name I have to write event = Event.from_id(id) event[0].name instead I want to write event = Event.from_id(id) event.name Am I doing something wrong here.. thanks in advance cheers sameera

    Read the article

  • Scala regex Named Capturing Groups

    - by Brent
    In scala.util.matching.Regex trait MatchData I see that there support for groupnames (Named Capturing Groups) But since Java does not support groupnames until version 7 as I understand it, Scala version 2.8.0.RC4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6. gives me this exception: scala> val pattern = """(?<login>\w+) (?<id>\d+)""".r java.util.regex.PatternSyntaxException: Look-behind group does not have an obvio us maximum length near index 11 (?<login>\w+) (?<id>\d+) ^ at java.util.regex.Pattern.error(Pattern.java:1713) at java.util.regex.Pattern.group0(Pattern.java:2488) at java.util.regex.Pattern.sequence(Pattern.java:1806) at java.util.regex.Pattern.expr(Pattern.java:1752) at java.util.regex.Pattern.compile(Pattern.java:1460) So the question is Named Capturing Groups supported in Scala? If so any examples out there? If not I might look into the Named-Regexp lib from clement.denis.

    Read the article

  • Weird bug in 'tar' not including files named .__init__.py

    - by Sridhar Ratnakumar
    Does anyone know why tar is not including files named .__init__.py (note the dot)? $ mkdir /tmp/work && cd /tmp/work $ mkdir foo $ touch foo/.__init__.py $ touch foo/.namespace__init__.py $ tar czf foo.tar.gz foo $ mkdir e && mv foo.tar.gz e/ && cd e/ $ tar zxf foo.tar.gz $ ls -al foo/ total 0 drwxr-xr-x 2 sridharr wheel 102 14 Mar 17:16 . drwxr-xr-x 3 sridharr wheel 136 14 Mar 17:17 .. -rw-r--r-- 1 sridharr wheel 0 14 Mar 17:16 .namespace__init__.py $ $ echo ".__init__.py file is missing. WTF? This is OSX 10.6"

    Read the article

  • named-checkzone reports 'ns.example.com.ns' has no address records (A or AAAA)

    - by hydroparadise
    The first thing I see wrong is that its a recursion problem. But I'm not sure where the problems lie in my reverse lookup file. ns should report back as ns.example.com but instead getting ns.example.com.ns. Of course it wouldn't find any entries for that name because there isn't one, nor is it supposed to. Here's my reverse file: $TTL 86400 @ IN SOA ns.example.com root.example.com. ( 16071990 ; Serial 3600 ; Refresh 1800 ; Retry 604800 ; Expire 86400 ; Minimum TTL ) @ IN NS ns.example.com It's not extraordinarily complicated. What my question is, what other files affect the output for named-checkzone when checking a name against the revers file?

    Read the article

  • Can't connect to sql server 2008 named instance

    - by hcsrpm
    I have sql server 2005 and 2008 running on a server on my local (and very straightforward) network. Using sql management studio 2008 and visual studio 2008, I can connect over the network to the 2005 instance which is the default instance. I can't connect to the 08 instance (named MC08). I can connect to both when logged in to the server. Remote connections have been enabled for MC08 and dynamic ports is turned off (assigned to port 1045). The sql browser service is running as well. This used to work so I'm not sure what has changed. I can't connect using the IP address either. Nothing unusual in the event log either. Any ideas?

    Read the article

  • configuring DNS zone file and named.conf

    - by tike
    Hi, i was trying to configure DNS in a way so that i could be able to run two domain name. I am able to do one as its preety simple and easy. e.g. test.com now i want to run test1.com in same machine. how do i configure zone file and named.conf. but i have no concept at all. any clue appreciated. thanks Tikejhya.

    Read the article

  • DNS Zone file and virtual host question (repost because my question got moved and now I can't comment on the original for some reason)

    - by Jake
    Sorry this is a repost, the original question got moved to here form stack overflow and for some reason I can't comment or respond to answers on that one anymore. Hi all, I'm trying to set up a virtual host for redmine.SITENAME.com. I've edited the httpd.conf file and now I'm trying to edit my DNS settings. However, I'm not sure exactly what to do. Here's an snippet of what's already in the named.conf file (the file was made by someone else who is unreachable): zone "SITENAME.com" { type master; file "SITENAME.com"; allow-transfer { ip.address.here.00; common-allow-transfer; }; }; I figure if I want to get redmine.SITENAME.com working, I need to copy that entry and just replace SITENAME.com with redmine.SITENAME.com but will that work? I was under the impression I needed a .db file but I don't see any reference to one in the current named.conf file. I also don't see any .db files or files named SITENAME in named.conf's directory. Any ideas where these illusive pre-existing db files could be?

    Read the article

  • Fedora 13 - No module named yum

    - by drozzy
    This is driving me bananas! After a recent update in Fedora 13 64bit, my yum is gone: $> yum update There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum Please install a package which provides this module, or verify that the module is installed correctly. I tried looking for an RPM yum package - to install yum. I went to the Fedora site: http://fedoraproject.org/wiki/Tools/yum Call me blind but I cannot find it anywhere on that page! Most of the solutions suggest repairing yum... with yum! But I don't have yum? Yum yum yum? :< Any help? Here are some outputs for rpm commands: $> rpm -ql python | grep "site-packages$" /usr/lib/python2.6/site-packages /usr/lib64/python2.6/site-packages $> rpm -ql yum | grep "site-packages/yum$" /usr/lib/python2.6/site-packages/yum

    Read the article

  • Using bind (named) as a public proxy server

    - by TrentDavis
    We have a Python DNS server that does a bunch of stuff to figure out values it should return for various DNS records. This works nicely, however as it is Python, the performance under high load won't be great. What I would like to do is have a "proxy" bind server sit in front of it to return results to the public internet. This will cache the results (typically 15 minutes, some records are a few seconds), so the load on the Python server will be greatly reduced as it will only see one look up per domain (only about 100 domains) every 15 minutes. The data in these domains changes a lot, so using a master won't work as it will constantly be changing. I have something setup that looked like it would work great (using a forwarder for the zone), and tested it with dig etc, all going great. However when we went to go live with it, things weren't working, and we figured out that named is not setting the "Authoritative" bit (fair enough, it is a forwarder). So my question is, can we tell bind to set the Authoritative bit for forwarded domains? I have looked at all the doco I can find, and can't find anything about doing things this way. Most of the doco about using it as a proxy if for a LAN to the internet. Ideally I would like to use bind as it is there and installed (CentOS 5 servers). But at a pinch we could look at a different name server to do the work if it just can't be done with bind. Thanks.

    Read the article

  • "ImportError: No module named flask" - Trouble with nginx + uWSGI + Flask in a virtualenv setup

    - by vjk2005
    I got nginx + uWSGI running on localhost inside a virtualenv with a simple hello world program, but I get this error when I replace the hello world with a simple Flask app: File "./wsgi_configuration_module.py", line 1, in <module> from flask import Flask ImportError: No module named flask unable to load app mountpoint Here's the flask app (wsgi_configuration_module.py): from flask import Flask application = Flask(__name__) @application.route("/") def hello(): return "hello world" if __name__ == "__main__": application.run() uWSGI config (app_conf.xml): <uwsgi> <socket>127.0.0.1:9001</socket> <chdir>/srv/www/labs/application</chdir> <pythonpath>/srv/www</pythonpath> <module>wsgi_configuration_module</module> <callable>application</callable> <no-site>true</no-site> </uwsgi> nginx config: server { listen 80; server_name localhost; access_log /srv/www/labs/logs/access.log; error_log /srv/www/labs/logs/error.log; location / { include uwsgi_params; uwsgi_pass 127.0.0.1:9001; } location /static { root /srv/www/labs/public_html/static/; index index.html index.htm; } } virtualenv stored in ~/virtual_env with Python 2.7 + nginx + uWSGI + Flask installed in a virtualenv called basic. Things I've tried to solve this: set the --home (-H) option to my virtualenv folder ~/virtual_env while running uWSGI. Other info: I have the same setup working outside of a virtualenv. Things go wrong only when I try to replicate the setup inside of a virtualenv. Where have I gone wrong?

    Read the article

  • Excel 2007: Named ranges problems when linking workbooks

    - by Mike
    I've 30+ workbooks each with 5 specific worksheets (formated the same). Each worksheet's data needs to be linked to a master workbook, so that I end up with 5 master workbooks and all the specific data in one long table format $A$2:$I$750. (Are you still with me? ;)) I don't have access to a database, so I'm having to link the sheets to their master workbook directly. I've highlighted the data I need; named the range; and then tried referencing this from my master workbook. I get the #Value error symbol when I try to link (=[WorkbookName]!MyNamedRange) to a cell that doesn't match the top left cell of my range. Example: MyNamedrange is always =$A$2:$I43$ on one specific sheet. On my master workbook it works if it's referenced at A2 but I get #Value if it's referenced A1, or A44. Any ideas? I'm trying to link my data in one continous table so I can run a pivot on it, and other things. Can it be done like this, or should I just copy and paste? I'm trying to keep things 'linked'so I do not need to spend time C&Ping all day. Many thanks Mike.

    Read the article

  • Apache Named Virtual Hosts and HTTPS

    - by Freddie Witherden
    I have an SSL certificate which is valid for multiple (sub-) domains. In Apache I have configured this as follows: In /etc/apache2/apache2.conf NameVirtualHost <my ip>:443 Then for one named virtual host I have <VirtualHost <my ip>:443> ServerName ... SSLEngine on SSLCertificateFile ... SSLCertificateKeyFile ... SSLCertificateChainFile ... SSLCACertificateFile ... </VirtualHost> Finally, for every other site I want to be accessible over HTTPS I just have a <VirtualHost <my ip>:443> ServerName ... </VirtualHost> The good news is that it works. However, when I start Apache I get warning messages [warn] Init: SSL server IP/port conflict: Domain A:443 (...) vs. Domain B:443 (...) [warn] Init: SSL server IP/port conflict: Domain C:443 (...) vs. Domain B:443 (...) [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!! So, my question is: how should I be configuring this? Clearly from the warning messages I am doing something wrong (although it does work!), however, the above configuration was the only one I could get to work. It is somewhat annoying as the configuration files have an explicit dependence on my IP address.

    Read the article

  • Not all named parameters have been set Nhibernate?

    - by user144842
    I got a problem whenever I pass char ":" from the user interface. NHibernate mistakes it as a named parameter and throws an error, since there isn't any value for it. Exception is :- Not all named parameters have been set: [%] [SELECT COUNT (*) FROM Test2 t WHERE t.FirstName LIKE ':%' AND t.LocationUID IN (38, 20)]"

    Read the article

  • Is it possible ot mix named pipe with select in perl

    - by Haiyuan Zhang
    I need to write a daemon that supposed to have one TCP socket and one named pipe. Usually if I need to implement a multi IO server with "pure" sockets, the select based multi-IO model is always the one I will choose. so does anyone of you have ever used named pipe in select or you can just tell me it is impossible. thanks in advance.

    Read the article

  • How to get named excel sheets while exporting from SSRS

    - by rao
    Whenever a single page report is exported to excel, sheet in excel is named by the report name. If a report has multiple pages, the sheets are named as sheet1, sheet2,.... Is there any way to specify sheet names in SSRS 2005 ? solution: Found this after some googleing: Changing the Sheet names in SQL Server RS Excel: QnD XSLT Will try out and post an update if it works.

    Read the article

  • Can AC_CHECK_LIB be used for unconventionally named libraries?

    - by aleph
    AC_CHECK_LIB accepts as an argument the base name of the shared library that you want to check for. So for a library named "libxyz.so" you would specify the base name of the library "xyz" as an argument to AC_CHECK_LIB. If I have a library named xyz.so (Note: Not libxyz.so), how do I check for the availability/usability of this library with autoconf ?

    Read the article

  • Hibernate Native Query problem with named parameters

    - by dime
    I have a problem with Hibernate Native Query. I have one SELECT that selects array slice (PostgreSQL database). The problem is that hibernate recognizes the following part: ":300" from "SELECT my_array[1:300]..." as named parameter and I get the following exception: Not all named parameters have been set. I tried to escape the colon (:) with '\:' , '::' but with no success. The Hibernate version is 3.2

    Read the article

  • What's the difference between a Table and a Named Range in Excel 2007?

    - by technomalogical
    Can someone explain the difference between Tables and Named Ranges in Excel 2007? It seems that in addition to having the features of Named Ranges, they're somehow marked as Tables which gives them special formatting & filtering options in the ribbon. Other questions: Can I treat a table as a named range? Does a named range provide me any functionality not offered by a table, and vice versa? Should I use one over the other (assuming that consumers of the spreadsheet are using Excel 2007 or higher)? Google has not been helpful (excel difference between named range and table and excel 2007 difference between named range and table) and I've found one resource describing table functionality, but no reference to named ranges.

    Read the article

  • Suspicious process running under user named

    - by Amit
    I get a lot of emails reporting this and I want this issue to auto correct itself. These process are run by my server and are a result of updates, session deletion and other legitimate session handling reported as false positives. Here's a sample report: Time: Sat Oct 20 00:00:03 2012 -0400 PID: 20077 Account: named Uptime: 326117 seconds Executable: /usr/sbin/nsd\00507d27e9\0053\00\00\00\00\00 (deleted) The file system shows this process is running an executable file that has been deleted. This typically happens when the original file has been replaced by a new file when the application is updated. To prevent this being reported again, restart the process that runs this excecutable file. See csf.conf and the PT_DELETED text for more information about the security implications of processes running deleted executable files. Command Line (often faked in exploits): /usr/sbin/nsd -c /etc/nsd/nsd.conf Network connections by the process (if any): udp: xx.xx.xxx.xx:53 -> 0.0.0.0:0 udp: 127.0.0.1:53 -> 0.0.0.0:0 udp: xx.xx.xxx.xx:53 -> 0.0.0.0:0 tcp: xx.xx.xxx.xx:53 -> 0.0.0.0:0 tcp: 127.0.0.1:53 -> 0.0.0.0:0 tcp: xx.xx.xxx.xx:53 -> 0.0.0.0:0 Files open by the process (if any): /dev/null /dev/null /dev/null Memory maps by the process (if any): 0045e000-00479000 r-xp 00000000 fd:00 2582025 /lib/ld-2.5.so 00479000-0047a000 r--p 0001a000 fd:00 2582025 /lib/ld-2.5.so 0047a000-0047b000 rw-p 0001b000 fd:00 2582025 /lib/ld-2.5.so 0047d000-005d5000 r-xp 00000000 fd:00 2582073 /lib/i686/nosegneg/libc-2.5.so 005d5000-005d7000 r--p 00157000 fd:00 2582073 /lib/i686/nosegneg/libc-2.5.so 005d7000-005d8000 rw-p 00159000 fd:00 2582073 /lib/i686/nosegneg/libc-2.5.so 005d8000-005db000 rw-p 005d8000 00:00 0 005dd000-005e0000 r-xp 00000000 fd:00 2582087 /lib/libdl-2.5.so 005e0000-005e1000 r--p 00002000 fd:00 2582087 /lib/libdl-2.5.so 005e1000-005e2000 rw-p 00003000 fd:00 2582087 /lib/libdl-2.5.so 0062b000-0063d000 r-xp 00000000 fd:00 2582079 /lib/libz.so.1.2.3 0063d000-0063e000 rw-p 00011000 fd:00 2582079 /lib/libz.so.1.2.3 00855000-0085f000 r-xp 00000000 fd:00 2582022 /lib/libnss_files-2.5.so 0085f000-00860000 r--p 00009000 fd:00 2582022 /lib/libnss_files-2.5.so 00860000-00861000 rw-p 0000a000 fd:00 2582022 /lib/libnss_files-2.5.so 00ac0000-00bea000 r-xp 00000000 fd:00 2582166 /lib/libcrypto.so.0.9.8e 00bea000-00bfe000 rw-p 00129000 fd:00 2582166 /lib/libcrypto.so.0.9.8e 00bfe000-00c01000 rw-p 00bfe000 00:00 0 00e68000-00e69000 r-xp 00e68000 00:00 0 [vdso] 08048000-08074000 r-xp 00000000 fd:00 927261 /usr/sbin/nsd 08074000-08079000 rw-p 0002b000 fd:00 927261 /usr/sbin/nsd 08079000-0808c000 rw-p 08079000 00:00 0 08a20000-08a67000 rw-p 08a20000 00:00 0 b7f8d000-b7ff2000 rw-p b7f8d000 00:00 0 b7ffd000-b7ffe000 rw-p b7ffd000 00:00 0 bfa6d000-bfa91000 rw-p bffda000 00:00 0 [stack] Would /etc/nsd/restart or kill -1 20077 solve the problem?

    Read the article

  • Named pipe blocking with user nobody

    - by dnagirl
    I have 2 short scripts. The first, an awk script, processes a large file and prints to a named pipe 'myfifo.dat'. The second, a Perl script, runs a LOAD DATA LOCAL INFILE 'myfifo.dat'... command. Both of these scripts work when run locally like so: lee.awk big.file & lee.pl However, when I call these scripts from a PHP webpage, the named pipe blocks: $awk="/path/to/lee.awk {$_FILES['uploadfile']['tmp_name']} &"; $sql="/path/to/lee.pl"; if(!exec($awk,$return,$err)) throw new ZException(print_r($err,true)); //blocks here if(!exec($sql,$return,$err)) throw new ZException(print_r($err,true)); If I modify the awk and Perl scripts so that they write and read to a normal file, everything works fine from PHP. The permissions on the fifo and the normal file are 666 (for testing purposes). These operations run much more quickly through a named pipe, so I'd prefer to use one. Any ideas how to unblock it? ps. In case you're wondering why I'm going to all this aggravation, see this SO question.

    Read the article

  • Low Throughput on Windows Named Pipe Over WAN

    - by MichaelB76
    I'm having problems with low performance using a Windows named pipe. The throughput drops off rapidly as the network latency increases. There is a roughly linear relationship between messages sent per second and round trip time. It seems that the client must ack each message before the server will send the next one. This leads to very poor performance, I can only send 5 (~100 byte) messages per second over a link with an RTT of 200 ms. The pipe is asynchronous, using multiple overlapped write operations (and multiple overlapped reads at the client end), but this is not improving throughput. Is it possible to send messages in parallel over a named pipe? The pipe is created using PIPE_TYPE_MESSAGE, would PIPE_READMODE_BYTE work better? Is there any other way I can improve performance? This is a deployed solution, so I can't simply replace the pipe with a socket connection (I've read that Windows named pipe aren't recommended for use over a WAN, and I'm wondering if this is why). I'd be grateful for any help with this matter.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >