Search Results

Search found 1375 results on 55 pages for 'rob sanders'.

Page 44/55 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • session variable not available in global before(:each, :type => :controller)

    - by Rob
    Hi, I'm refactoring some specs, in controller specs I have a before(:each) which sets up things required in the session my before filter is... config.before(:each, :type => :controller) do ... session[:current_user] = @user session[:instance] = @instance ... end @user and @instance are also set in the before(:each) i've just hidden them for readability here I get the following error when running the controller tests undefined method `session' for nil:NilClass I would expect the global before callbacks to have the same things as the ones in the individual tests but I guess maybe they are loaded before the rails environment has been initialised? Thanks

    Read the article

  • Template apps for iPhone

    - by rob
    Is there a good place to get starter apps for iPhone, where you choose from any of a large set of permutations?...for instance with a nav bar and a flip screen and a 3 deep table view, with Core Data support etc. I guess what I was hoping for is some kind of wizard where you can check a few boxes and have a working app as a starting point....but more than just the 3 or 4 choices that come with xCode. If not a wizard, just a nice set of a couple dozen permutations. Also....is there any good sample apps out there that show the difference between identical apps, one which uses Interface Builder and one not? Aside from being handy for myself, I'd think these would be great as a teaching tool. I've googled a bit and come up with nothing.

    Read the article

  • MySQL Update query with left join and group by

    - by Rob
    I am trying to create an update query and making little progress in getting the right syntax. The following query is working: SELECT t.Index1, t.Index2, COUNT( m.EventType ) FROM Table t LEFT JOIN MEvents m ON (m.Index1 = t.Index1 AND m.Index2 = t.Index2 AND (m.EventType = 'A' OR m.EventType = 'B') ) WHERE (t.SpecialEventCount IS NULL) GROUP BY t.Index1, t.Index2 It creates a list of triplets Index1,Index2,EventCounts. It only does this for case where t.SpecialEventCount is NULL. The update query I am trying to write should set this SpecialEventCount to that count, i.e. COUNT(m.EventType) in the query above. This number could be 0 or any positive number (hence the left join). Index1 and Index2 together are unique in Table t and they are used to identify events in MEvent. How do I have to modify the select query to become an update query? I.e. something like UPDATE Table SET SpecialEventCount=COUNT(m.EventType)..... but I am confused what to put where and have failed with numerous different guesses.

    Read the article

  • A way to make md5_file() faster?

    - by Rob
    I currently use md5_file(); to run through about 15 URLs and verify their MD5. Is there a way I can make this faster? It takes far too long to run through all of them. Sorry if this isn't a good question, I just realized its only three (four if you count this one) sentences long.

    Read the article

  • LINQ Sorting - First three need to be different manufacturers

    - by Rob
    My OM has a 'product' object. Each product has a 'manufacturer id' (property, integer). When I have a list of products to display, the first three are displayed as the 'featured products'. The list is already sorted in a specific sort order, putting the 'featured' products first in the list. However, I now need to ensure the featured products in the listing are from different Manufacturers. I want to have a method to call to do this re-sorting. Trying to utilize LINQ to to the querying of the input 'products' and the 'results' public List<Product> SetFeatures(List<Product> products, int numberOfFeatures) { List<Product> result; // ensure the 2nd product is different manufacturer than the first .... // ensure the 3rd product is a different manufacturer than the first two... // ... etc ... for the numberOfFeatures return result; } Thanks in advance.

    Read the article

  • Is there a way in C# 4.0 to have a method take a delegate with the parameters baked in?

    - by Rob Packwood
    I have this code for reporting on a simple demo app I am writing: private static void ReportOnTimedProcess(Action process) { var stopwatch = new Stopwatch(); stopwatch.Start(); process(); stopwatch.Stop(); Console.WriteLine("Process took {0} seconds", stopwatch.ElapsedMilliseconds*1000); } I basically want to track the time of any process. I am trying to have this method take a delegate as a parameter that can have any number of varying parameters. Is there some way an Expression can do this?

    Read the article

  • MySQL Full-text Search Workaround for innoDB tables

    - by Rob
    I'm designing an internal web application that uses MySQL as its backend database. The integrity of the data is crucial, so I am using the innoDB engine for its foreign key constraint features. I want to do a full-text search of one type of records, and that is not supported natively with innoDB tables. I'm not willing to move to MyISAM tables due to their lack of foreign key support and due to the fact that their locking is per table, not per row. Would it be bad practice to create a mirrored table of the records I need to search using the MyISAM engine and use that for the full-text search? This way I'm just searching a copy of the data and if anything happens to that data it's not as big of a deal because it can always be re-created. Or is this an awkward way of doing this that should be avoided? Thanks.

    Read the article

  • How to Parse 'Mathy' Stuff...

    - by Rob P.
    Please forgive my title, I really don't know how to phrase it better. This isn't a school assignment or anything, but I realize it's a mostly academic question. But, what I've been struggling to do is parse 'math' text and come up with an answer. For Example - I can figure out how to parse '5 + 5' or '3 * 5' - but I fail when I try to correctly chain operations together. (5 + 5) * 3 It's mostly just bugging me that I can't figure it out. If anyone can point me in a direction, I'd really appreciate it.

    Read the article

  • C#, working with files, "Unauthorized Access"?

    - by Rob
    Hi, I'm learning about opening and saving files with C# and it seems that vista won't let my program save to a file on the root of C:\ , unless I run it in administrator mode. Any ideas how to allow my program to play around with whatever files it wants? Thanks! string name; private void button2_Click(object sender, EventArgs e) ///// OPEN ///// { if (openFileDialog1.ShowDialog() == DialogResult.OK) { name = openFileDialog1.FileName; textBox1.Clear(); textBox1.Text = File.ReadAllText(name); textBox2.Text = name; } } private void button1_Click(object sender, EventArgs e) ///// SAVE ///// { File.WriteAllText(name, textBox1.Text); }

    Read the article

  • Running a python script for a user-specified amount of time?

    - by Rob
    Sorry, this is probably a terrible question. I've JUST started learning python today. I've been reading a Byte of Python. Right now I have a project for Python that involves time. I can't find anything relating to time in Byte of Python, so I'll ask you: How can I run a block for a user specified amount of time and then break? For example (in some pseudo-code): time = int(raw_input('Enter the amount of seconds you want to run this: ')) while there is still time left: #run this block or even better: import sys time = sys.argv[1] while there is still time left: #run this block Thanks for any help. Also, additional online guides and tutorials would be much appreciated. I really like Byte of Python. Dive into Python can't quite hold my attention, though. I suppose I should suck it up and try harder to read that one.

    Read the article

  • Help getting PHP sessions to persist after being taken off-site

    - by Rob
    Hi, we're working on a payment gateway system with PHP. We use sessions to store the shopping cart data. The system takes you off-site to the payment processor's site, and then return you to your site. On most hosts, we have no issues when we arrive back at our site and having the session data still be there. On those with an issue, turning off the PHP session referer_check has worked in the past. We don't really want to have to include the PHPSESSID as a GET variable, and hope to avoid that. What I'm looking for is what other server configurations would cause the session to be killed, and any other workarounds there might be. Thanks for your help.

    Read the article

  • Using date functions in android application?

    - by rob
    Hi there, I am displaying some event data based on the todays event and a list of events in a week. Currently I am displaying all the events in form of list from the file, As the file contains out dated events as well but I want to display on the basis of today's date events and a week events then week after. In short I want to restrict the list on the basis of this and extract information. I know there is a class java.util containing Date class, but need some quick idea and help how can I do this? Can anyone quote example? Thanks

    Read the article

  • How to setup a development Active Directory

    - by Rob
    Does anyone have any suggestions on how to setup a development environment for active directory? We are thinking of using development.contoso.com or something along those lines that is a completely separate envnironment from our production. This will be used for things like Dev SharePoint and possibly a Dev exchange server. Maybe even a dev CRM. We are thinking of setting this up all using virtual machines. Possibly having the production get replicated down on a regular basis as well. Does anyone have an experience with this or any suggestions on what to do or not to do for this?

    Read the article

  • Ordering by number of rows?

    - by Rob
    Alright, so I have a table outputting data from a MySQL table in a while loop. Well one of the columns it outputs isn't stored statically in the table, instead it's the sum of how many times it appears in a different MySQL table. Sorry I'm not sure this is easy to understand. Here's my code: $query="SELECT * FROM list WHERE added='$addedby' ORDER BY time DESC"; $result=mysql_query($query); while($row=mysql_fetch_array($result, MYSQL_ASSOC)){ $loghwid = $row['hwid']; $sql="SELECT * FROM logs WHERE hwid='$loghwid' AND time < now() + interval 1 hour"; $query = mysql_query($sql) OR DIE(mysql_error()); $boots = mysql_num_rows($query); //Display the table } The above is the code displaying the table. As you can see it's grabbing data from two different MySQL tables. However I want to be able to ORDER BY $boots DESC. But as its a counting of a completely different table, I have no idea of how to go about doing that. I would appreciate any help, thank you.

    Read the article

  • Starting a personal reuasable code repository.

    - by Rob Stevenson-Leggett
    Hi, I've been meaning to start a library of reusable code snippets for a while and never seem to get round to it. At the moment I just tend to have some transient classes/files that I drag out of old projects. I think my main problems are: Where to start. What structure should my repository take? Should it be a compiled library (where appropriate) or just classes/files I can drop into any project? Or a library project that can be included? What are the licencing implications of that? In my experience, a built/minified library will quickly become out of date and the source will get lost. So I'm leaning towards source that I can export from SVN and include in any project. Intellectual property. I am employeed, so a lot of the code I write is not my IP. How can I ensure that I don't give my own IP away using it on projects in work and at home? I'm thinking the best way would be to licence my library with an open source licence and make sure I only add to it in my own time using my own equipment and therefore making sure that if I use it in a work project the same rules apply as if I was using a third party library. I write in many different languages and often would require two or more parts of this library. Should I look at implementing a few template projects and a core project for each of my chosen reusable components and languages? Has anyone else got this sort of library and how do you organise and update it?

    Read the article

  • Is there a way to check if a host is up?

    - by Rob
    I'm trying to do this in PHP. I need to check if a specified host is "up" I thought of pinging the specified host (though I'm not sure how I would, since that would require root. --help here?) I also though of using fsockopen() to try to connect on a specified port, but that would fail too, if the host wasn't listening for connections on that port. Additionally, some hosts block ping requests, so how might I get around this? This part isn't a necessity, though, so don't worry about this too much. I realize this one might get tricky.

    Read the article

  • How to replicate Google "Hangouts On Air" stream combining functionality?

    - by Rob Olmos
    I've been researching this one for quite a bit but haven't found any solid leads. I have a Wowza/Flash app with video chatroom functionality and would like to combine the streams server-side into one video/audio stream in order to be sent to a live Youtube channel. I've found a couple projects such as jMixer and some helpful keywords such as "vision mixer" to help with my search but looking for any previous experience or new ideas. The other option is building something like it myself with a commercial video decoding/encoding library to raw frames, stitching the frames together, then encoding it. I was originally going down this route but put project on hold. What are some ideas, keywords, or existing software (open source preferred) to take those live streams and combine them into one in real-time? Or is coding it myself the required route? Thanks!

    Read the article

  • What are the PHP "encryption" functions?

    - by Rob
    Looking for built in encryption functions, not to hide the string from the clever programmer, but instead just to obfuscate it a bit. Looking for functions such as str_rot13 and base64_encode, but I can't seem to locate any. Surely there are more?

    Read the article

  • Where does getopt_long store an unrecognized option?

    - by Rob Kennedy
    When getopt or getopt_long encounters an illegal option, it stores the offending option character in optopt. When the illegal option is a long option, where can I find out what the option was? And does anything meaningful get stored in optopt then? I've set opterr = 0 to suppress the automatically printed error message. I want to create my own message that I can print or log where I'd like, but I want to include the name of the unrecognized option.

    Read the article

  • Using PHP to determine if a remote file has been replaced?

    - by Rob
    I have a MySQL database with some URLs in it. One URL per row. Each URL has my script on it. What I am wanting to do, is check if the file is still there via a PHP script. Not check if it 404'd, but rather check if it has been modified or replaced. Is this possible? If so, how would it be accomplished? I was thinking making the remote file echo some string, and having the local file check the page for that string, but that seems a little inefficient and sloppy.

    Read the article

  • Jython project in Eclipse can't find the xml module, but works in an identical project

    - by Rob Lourens
    I have two projects in Eclipse with Java and Python code, using Jython. Also I'm using PyDev. One project can import and use the xml module just fine, and the other gives the error ImportError: No module named xml. As far as I can tell, all the project properties are set identically. The working project was created from scratch and the other comes from code checked out of an svn repository and put into a new project. What could be the difference? edit- Same for os, btw. It's just missing some path somewhere...

    Read the article

  • Stocket server crashing with unhandled exception

    - by Rob
    We have a c# (3.5 framework) socket server which is a console app, after about 3000 connections (or less, it's quite random), we get an unhandled exception which crashes the app completely. We're really struggling to find out what's happening and where, the only info we get is below, can anyone shed any light? It should be noted that EVERYTHING is wrapped up in try catch{} Description: Stopped working Problem signature: Problem Event Name: CLR20r3 Problem Signature 01: qrushrserver.exe Problem Signature 02: 1.0.0.0 Problem Signature 03: 4bf56a0c Problem Signature 04: System Problem Signature 05: 2.0.0.0 Problem Signature 06: 49cc5ec9 Problem Signature 07: 2c0b Problem Signature 08: 40 Problem Signature 09: System.Net.Sockets.Socket OS Version: 6.0.6002.2.2.0.1296.17 Locale ID: 2057 Faulting application app_name.exe, version 1.0.0.0, time stamp 0x4bf56a0c, faulting module mscorwks.dll, version 2.0.50727.4200, time stamp 0x4a9ee32d, exception code 0xc0000005, fault offset 0x00000000001c89ca, process id 0x%9, application start time 0x%10. .NET Runtime version 2.0.50727.4200 - Fatal Execution Engine Error (000007FEF8E4664E) (80131506)

    Read the article

  • What is the most underused or underappreciated design pattern?

    - by Rob Packwood
    I have been reading a lot on design patterns lately and some of them can make our lives much easier and some of them seem to just complicate things (at least to me they do). I am curious to know what design patterns everyone sees as underunsed or underappreciated. Some patterns are simple and many people do not even realize they are using a pattern (decorator probably being the most used, without realized). My goal from this is to give us pattern-newbies some appreciation for some of the more complex or unknown patterns and why we should use them.

    Read the article

  • Python Continue Loop

    - by Rob B.
    I am using the following code from this tutorial (http://jeriwieringa.com/blog/2012/11/04/beautiful-soup-tutorial-part-1/). from bs4 import BeautifulSoup soup = BeautifulSoup (open("43rd-congress.html")) final_link = soup.p.a final_link.decompose() trs = soup.find_all('tr') for tr in trs: for link in tr.find_all('a'): fulllink = link.get ('href') print fulllink #print in terminal to verify results tds = tr.find_all("td") try: #we are using "try" because the table is not well formatted. This allows the program to continue after encountering an error. names = str(tds[0].get_text()) # This structure isolate the item by its column in the table and converts it into a string. years = str(tds[1].get_text()) positions = str(tds[2].get_text()) parties = str(tds[3].get_text()) states = str(tds[4].get_text()) congress = tds[5].get_text() except: print "bad tr string" continue #This tells the computer to move on to the next item after it encounters an error print names, years, positions, parties, states, congress However, I get an error saying that 'continue' is not properly in the loop on line 27. I am using notepad++ and windows powershell. How do I make this code work?

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >