Daily Archives

Articles indexed Tuesday March 9 2010

Page 5/49 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Rspec Faker has_one fail in view

    - by Victor Martins
    I' trying to fix this for hours... I have this on a controller rspec test: it "show action should render show template" do task = Task.make task.mission = Mission.make get :show, :id => task response.should render_template(:show) end But it fails rendering the view because of this: <%=h @task.mission.name %> I don't get it... :/

    Read the article

  • Vim Register Use in Ex Mode

    - by Peck
    Potentially 2 questions in one. I would like to know how to reference a register in Ex mode. For instance, I'm editing a file and I want to save the file with a timestamp (or just datestamp really) appended to it. I know I can set register to the value of a shell commands output using: :let @a = system("date +\"%Y-%m-%d\"") Is there any to dereference this register and insert its value into an Ex command? Something like: :w testfile.<value of "a register> Copying to the system clipboard and pasting would be nice, but doing it in a more generic/programitic way for building on other commands in the future would be nice.

    Read the article

  • How to simulate a fake MouseOver on a Flash applet in a webpage?

    - by Mason Wheeler
    I listen to internet radio at http://player.play.it/player/player.htm and it works pretty well, except for one minor issue. The Flash applet that runs the radio player has a timer on it, where if you don't move the mouse over the player every once in a while, it decides you're idle and shuts off the stream, even if you're not actually idle, but just working on something else with the radio player running in the background. Is there any way I can send a fake MouseOver message to this applet to keep it from cutting me off in the middle of a song, maybe with a GreaseMonkey script? I'm using Firefox.

    Read the article

  • Basic proxy with OpenSSH, Cygwin, Putty

    - by clang1234
    I know this is probably a common question, but after looking around for a few hours (on this site and others), I can't find a solution. I'm trying to set up a simple proxy. I already have a server running Windows Server 2008. I've installed Cygwin and have OpenSSH installed. I also have sshd (the openssh daemon) running. Port 22 is forwarded correctly. On my client side I have Putty on a Windows 7 machine. I can successfully open a connection to my server and log in to access the shell. So what do I do next? Do I just name the ports I want tunneled in Putty or do I need to tell my SSH server what to do with those ports? Thanks for the help. Let me know if I left anything out.

    Read the article

  • Change cPanel MySQL User maximum character value

    - by David
    We are moving our websites to a new server, and in the process, have found that our current version of cPanel 11.24 doesn't have a maximum number of characters for a MySQL Database Username, like cPanel 11.25 does (it's set to 7). However, we have MySQL users whose names are longer than 7 characters. 1) Will something disastrous happen if we upgrade cPanel on our current server? 2) How can I change this setting in the new version of cPanel / WHM?

    Read the article

  • Trying to administer network setting of server via netsh

    - by Jaime
    Hi there, I am trying to configure the LAN settings of a Windows 2008 server remotely via netsh. I've been trying this command (issued at the client) assuming the IP address of the server is 192.168.0.1: netsh -r 192.168.0.1 -u 192.168.0.1\Administrator -p password lan show config but I keep getting the following message: WARNING: Could not obtain host information from machine [192.168.0.1]. Some commands may not be available. The RPC server is unavailable. Am I understanding the command above properly? Is there a step or two that I missed in setting this up? Thanks in advance. P.S. The Routing and Remove Access service on the server is enabled.

    Read the article

  • slow internet Problem on kubuntu 9.10 amd x64

    - by Abdelkrim-NET
    Hi everyone, i've recently installed kubuntu 9.10 amd x64, on an HP 6830s. The installation went smoothly, with only one problem: when I try to use the internet, it's incredibly slow. I couldn't install Firefox or anything that requires the internet. I have tried most of the solutions I found through Google, but none of them solves the problem. If anyone has an idea, I would appreciate the help.

    Read the article

  • Indesign Import XML into Automatic Page generation, data merge

    - by taudep
    I've created some InDesign Pages that I want to use as templates. I've created an XML file with all the appropriate data. I want to merge the XML data with the InDesign page and have a few hundred pages automatically generated. I've been reading online and working with InDesign's "Import XML" features without any luck. The documentation has been pretty poor for me. And Google searches haven't returned much fruitful. Edit: I'm updating this to now include my present steps 1) I create a Master Page of my template 2) I add a bunch of text frames where I want the imported data from the XML file to be places 3) I open the "Tags" window and Import and XML file 4) I mark my text frames in the Master Document with the appropriate tags 5) I then add a lot of pages (like 200) to the document 6) Then I use "Import XML" to try and get the data brought in and filled across all 200 pages. This is where I fail. So there's something I'm missing. It might be that InDesign doesn't work as I'm expecting... Anyone have any good tips for mail-merge like functionality with an XML document and auto-generation of InDesign pages? BTW, here's an example of Adobe's great documentation for merging repeated XML elements. There's gotta be more...InDesign CS4 Docs: XML-Importing XML-Working with Repeating Data EDIT: Here's some of the sample XML, notice the ITEM will repeat. I've also truncated the data in the "desc" tag: <output> <item> <user_name>taude</user_name> <date>2009-02-21</date> <title>Wishful Thinking</title> <desc>Skiing up in Vermont on a beautiful day. This photo of</desc> <thumbnail>http://www.blipfoto.com/thumbs/5371/2009/big/color/96104200949a162672e1996.15963073.jpeg</thumbnail> </item> <item> <user_name>taude</user_name> <date>2009-02-22</date> <title>Skiing Self Portrait</title> <desc>I was inspired by ML's self-portrait while </desc> <thumbnail>http://www.blipfoto.com/thumbs/5371/2009/big/color/36547696749a2c5782308e0.91477014.jpeg</thumbnail> </item> </output> Here's what my imported XML looks like with the InDesign Structure

    Read the article

  • Tools to (privately) annotate/markup a website for maintenance

    - by rob
    I've been tasked with updating a website. Rather than proofreading and updating each page (one at a time), I want to make a single pass over the entire website, marking graphics/images/videos that need to be rewritten, removed, or updated. I thought about taking screenshots, marking those up, and putting them in our bug-tracking database, but that seems like an extremely tedious solution. Some of the content is similar on various pages across the website, and the entire site itself is localized into several languages (so any changes made to the English version will have corresponding changes for other languages). I also want all of my markup to remain private (that is, if it's stored online somewhere, I should be the only person who can see my comments). I found an article that lists several website annotation services, but it's not clear whether they allow private annotations, or whether these tools are even appropriate for website maintenance (many of them look more geared toward social networking). I've started making a list of some necessary and desired features below, and may add more as necessary. Annotations/markup/comments remain private (only visible to me) Comment history/tagging (so I can reuse the same comment for shared footers, items requiring similar updates, etc.) Ability to print/export a list or report of all comments for the entire website Ability to produce a categorized list of changes (e.g., to produce a list of images that need updating, which I can send to the graphic designer) What processes and tools do you use to keep track of all the changes that need to be made to a website? What features are painfully absent from the tools you use?

    Read the article

  • sql server password reset

    - by Alex James
    Hi everybody I have deleted my windows account on wich I had installed sql server 2008 express. Now I can not perform any operation with my sql server including adding new user. Pleas sombody help me.

    Read the article

  • serverside controls vs html controls from AJAX point of view

    - by devmania
    hi, i know this question have been mentioned alot here but mine is a little more updated, now with ASP.net 4 and new Ajax client templating plus JASON services. so if i got all these new capabilities will i really need server side controls as long as i can bind on client side, create data-views on client side heck i can even use data-context and apply CRUD operations on clients side. so i actually i wont need button_click server side event or what so ever... i am asking this because i own some commercial Controls like Telerik and Component art and they both offer client side operations ow but still i am confused as to my knowledge creating these controls will still have to go through Page Life cycle please advise me.

    Read the article

  • Java: how to tell if a line in a text file was supposed to be blank?

    - by defn
    I'm working on a project in which I have to read in a Grammar file (breaking it up into my data structure), with the goal of being able to generate a random "DearJohnLetter". My problem is that when reading in the .txt file, I don't know how find out whether the file was supposed to be a completely blank line or not, which is detrimental to the program. Here is an example of part of the file, How do i tell if the next line was supposed to be a blank line? (btw I'm just using a buffered reader) Thanks! <start> I have to break up with you because <reason> . But let's still <disclaimer> . <reason> <dubious-excuse> <dubious-excuse> , and also because <reason> <dubious-excuse> my <person> doesn't like you I'm in love with <another> I haven't told you this before but <harsh> I didn't have the heart to tell you this when we were going out, but <harsh> you never <romantic-with-me> with me any more you don't <romantic> any more my <someone> said you were bad news

    Read the article

  • detecting circular imports

    - by wallacoloo
    I'm working with a project that contains about 30 unique modules. It wasn't designed too well, so it's common that I create circular imports when adding some new functionality to the project. Of course, when I add the circular import, I'm unaware of it. Sometimes it's pretty obvious I've made a circular import when I get an error like AttributeError: 'module' object has no attribute 'attribute' where I clearly defined 'attribute'. But other times, the code doesn't throw exceptions because of the way it's used. So, to my question: Is it possible to programmatically detect when and where a circular import is occuring?

    Read the article

  • iphone - using NSInvocation: constant value

    - by Mike
    I am dealing with an old iPhone OS 2.x project and I want to keep compatibility, while designing for 3.x. I am using NSInvocation, is a code like this NSInvocation* invoc = [NSInvocation invocationWithMethodSignature: [cell methodSignatureForSelector: @selector(initWithStyle:reuseIdentifier:)]]; [invoc setTarget:cell]; [invoc setSelector:@selector(initWithStyle:reuseIdentifier:)]; int arg2 = UITableViewCellStyleDefault; //???? [invoc setArgument:&arg2 atIndex:2]; [invoc setArgument:&identificadorNormal atIndex:3]; [invoc invoke]; to call 3.0 APIs on 2.0. I am having a problem on the line I marked with question marks. The problem there is that I am trying to assing to arg2, a constant that has not been defined in OS 2.0. As everything with NSInvocation is to do stuff indirectly to avoid compiler errors, how do I set this constant to a variable in an indirect way? Some sort of performSelector "assign value to variable"... is that possible? thanks for any help.

    Read the article

  • OpenCV 2.0 and Python

    - by Jive Dadson
    I cannot get the example Python programs to run. When executing the Python command "from opencv import cv" I get the message "ImportError: No module named _cv". There is a stale _cv.pyd in the site-packages directory, but no _cv.py anywhere. See step 5 below. MS Windows XP, VC++ 2008, Python 2.6, OpenCV 2.0 Here's what I have done. Downloaded and ran the MS Windows installer for OpenCV2.0. Downloaded and installed CMake Downloaded and installed SWIG Ran CMake. After unchecking "ENABLE_OPENMP" in the CMake GUI, I was able to build OpenCV using INSTALL.vcproj and BUILD_ALL.vcproj. I do not know what the difference is, so I built everything under both of those project files. The C example programs run fine. Copied contents of OpenCV2.0/Python2.6/lib/site-packages to my installed Python2.6/lib/site-packages directory. I notice that it contains an old _cv.pyd and an old libcv.dll.a.

    Read the article

  • iPhone UI addSubview causing concurrency exception

    - by Eli
    This is really odd... I run my app, and while it is opening and the views are constructing I get: Collection <CALayerArray: 0x124650> was mutated while being enumerated. The code trace goes through the following: main UIApplicationMain -[UIApplication _run] CFRunLoopRunInMode CFRunLoopRunSpecific _UIApplicationHandleEvent -[UIApplication sendEvent:] -[UIApplication handleEvent:withNewEvent:] -[UIApplication _runWithURL:sourceBundleID:] -[UIApplication _performInitilizationWithURL:sourceBundleID:] -[AppDelegate applicationDidFinishLaunching:] +[Controller initializeController] //This is my own function [window addSubview: pauseMenuController.view] //This is the last point of my code it goes through -[UIView(Hierarchy) addSubview:] -[UIView(Internal) _addSubview:positioned:relativeTo:] -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:] -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] _NSFastEnumerationMutationHandler objc_exception_throw I've run the game lots and lots and lots of times and I've never seen this, then suddenly it popped up. The weird thing is that I'm not creating any other threads (that I know of) until after this code all gets called. It'll be easier for me to debug this if someone can give me some explanation of what might be getting modified while it's being accessed in a UIView. Does it have something to do with adding something to the view while it's already adding something, maybe? Any ideas?

    Read the article

  • Warning: Memcache::connect(0memcache.connect0): Can't connect to localhost:11211, Connection refuse

    - by Stick it to THE MAN
    I am using Symfony 1.3.2 with Propel ORM on Ubuntu 9.10. I am incorporating memcache to the website. I have modified the setup() method in apps/frontend/ProjectConfiguration.class.php like this: class ProjectConfiguration { public function setup() { // original SF generated code here .. require_one sfConfig::get('sf_lib_dir').'/MyCache.class.php'; myCache::init(); } } my cache singleton is implemented something like this: class MyCache { private static memcache = null; private static inited = false; public static init() { if (self::$inited) return; self::$memcache = new Memcache(); if (self::$memcache->connect('localhost', 11211) { // Do some stuff .. self::$inited = true; } } } Warning: Memcache::connect(0memcache.connect0): Can't connect to localhost:11211, Connection refused(111) in /path_to_class/MyCache.class.php This happens for both CLI (e.g. running SF tasks) or for web access through the browser. Does anyone know how to resolve this (I suspect its something to do with Linux user privileges). As an aside, I am aware that SF prvoides an sfAPCache wrapper class for cacheing. I am intentionally not using it for two reasons: I cannot find any comprehensive (and up to date) docs on this class I want to learn the memcache API directly, since I will be accesing it from other languages.

    Read the article

  • Get the last '/' or '\\' character in Python

    - by wowus
    If I have a string that looks like either ./A/B/c.d OR .\A\B\c.d How do I get just the "./A/B/" part? The direction of the slashes can be the same as they are passed. This problem kinda boils down to: How do I get the last of a specific character in a string? Basically, I want the path of a file without the file part of it.

    Read the article

  • No Persistence provider for EntityManager named ...

    - by Robert A Henru
    I have my persistence.xml with the same name, using toplink, under META-INF directory. Then I have my code calling it with... EntityManagerFactory emfdb = Persistence.createEntityManagerFactory("agisdb"); Yet, I got the following error message 2009-07-21 09:22:41,018 [main] ERROR - No Persistence provider for EntityManager named agisdb javax.persistence.PersistenceException: No Persistence provider for EntityManager named agisdb at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:89) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60) Here is the persistence.xml... <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> <persistence-unit name="agisdb"> <class>com.agis.livedb.domain.AddressEntity</class> <class>com.agis.livedb.domain.TrafficCameraEntity</class> <class>com.agis.livedb.domain.TrafficPhotoEntity</class> <class>com.agis.livedb.domain.TrafficReportEntity</class> <properties> <property name="toplink.jdbc.url" value="jdbc:mysql://localhost:3306/agisdb"/> <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/> <property name="toplink.jdbc.user" value="root"/> <property name="toplink.jdbc.password" value="password"/> </properties> </persistence-unit> </persistence> It should have been in the classpath... Yet, I got the above error... Really appreciate any help... Thanks

    Read the article

  • How to do run length encoding?

    - by Phoenix
    I have a long string for example it could be "aaaaaabbccc". Need to represent it as "a6b2c3". What's the best way to do this ? I could do this in linear time by comparing characters and incrementing counts and then replacing the counts in the array, using two indexes in one pass. Can you guys think of a better way than this? Are any of the encoding techniques going to work here ?

    Read the article

  • Active Directory Programming help needed

    - by ricky2002
    Hello Friends, I want to make Windows Service in .NET which has to run on Windows Server 2003, 2008. The main functionalities i need are: As soon as a network user logs in, Display his: User name in Active Directory Domain Ip Address from where he connected I do not want to install or run any program/script on the client machine. Any help on how to go about developing this will be greatly appreciated. i saw some articles explaining this using the System.Environment namespace and some others but they only shed light for the local logged on user.

    Read the article

  • Parsec: backtracking not working

    - by Nathan Sanders
    I am trying to parse F# type syntax. I started writing an [F]Parsec grammar and ran into problems, so I simplified the grammar down to this: type ::= identifier | type -> type identifier ::= [A-Za-z0-9.`]+ After running into problems with FParsec, I switched to Parsec, since I have a full chapter of a book dedicated to explaining it. My code for this grammar is typeP = choice [identP, arrowP] identP = do id <- many1 (digit <|> letter <|> char '.' <|> char '`') -- more complicated code here later return id arrowP = do domain <- typeP string "->" range <- typeP return $ "("++domain++" -> "++range++")" run = parse (do t <- typeP eof return t) "F# type syntax" The problem is that Parsec doesn't backtrack by default, so > run "int" Right "int" -- works! > run "int->int" Left "F# type syntax" unexpected "-" expecting digit, letter, ".", "`" or end of input -- doesn't work! The first thing I tried was to reorder typeP: typeP = choice [arrowP, identP] But this just stack overflows because the grammar is left-recursive--typeP never gets to trying identP because it keeps trying arrowP over and over. Next I tried try in various places, for example: typeP = choice [try identP, arrowP] But nothing I do seems to change the basic behaviours of (1) stack overflow or (2) non-recognition of "-" following an identifier. My mistake is probably obvious to anybody who has successfully written a Parsec grammar. Can somebody point it out?

    Read the article

  • Mouse Event BHO

    - by shaimagz
    I want my BHO to listen to onmousedown event of some element in a certain webpage. I have all the code that find the specific element, and in msdn its says that I need to use the get_onmousedown event. I came up with this code. CComQIPtr<IHTMLElement> someElement; VARIANT mouse_eve; someElement->get_onmousedown(&mouse_eve); The question is, how do I tell it to run some function when this event occurs?

    Read the article

  • Fresh XP +click once +cannot connect

    - by niao
    Greetings, we have to following problem. Our application is deployed using ClickOnce. Everything is running fine and application is able to connect to the wcf service. The problem occurs when application is installed on FRESH XP machine without .net Framework and Windows Installater (that were selected in ClickOnce prerequities). Application downloads .NET Framework 3.5SP1 and windows installer but then it cannot connect the the server. Reboot after install does not help. The strange is that this application has been installed on 10 xp machines and 4 of them can connect to the service without a problem

    Read the article

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