Search Results

Search found 1439 results on 58 pages for 'rob ford'.

Page 39/58 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • How to make one ASP.NET MVC site "derive" from another.

    - by Rob Levine
    My question is similar to "ASP.NET 2 projects to share same files", but with an ASP.NET MVC slant. Basically, we have two sites, one being based mostly on the other (roughly 90% views, controllers, images, in the second are identical to the first). However, in some cases, the views may be different, or a controller in the second site may be different to the first. Are there any simple ways of achieving this in ASP.NET MVC? So far, we've looked at using linked files to have two totally seperate projects where the second project shares the files it needs from the first. One problem with this approach is that most pages in the second project don't literally exist in the virtual directory, it makes debugging a pain - you have to publish in order to generate the files so you can debug. Does anyone have any better approaches, or ways this approach can be simplified?

    Read the article

  • suppress keyboard in iphone UiWebViews

    - by rob
    I have an app that uses UiWebViews, and I need to not show the keyboard for a text field within such a view. I provide my own buttons that insert the limited sorts of text the field allows, but I also need to allow pasting (I will filter what gets pasted) and adjusting the cursor position. Any way to do this?

    Read the article

  • Is there a function that can read a php function post-parsing?

    - by Rob
    I've got a php file echoing hashes from a MySQL database. This is necessary for a remote program I'm using, but at the same time I need my other php script opening and checking it for specified strings POST parsing. If it checks for the string pre-parsing, it'll just get the MySQL query rather than the strings to look for. I'm not sure if any functions do this. Does fopen() read the file prior to parsing? or file_get_contents()? If so, is there a function that'll read the file after the php and mysql code runs? The file with the hashes query and echo is in the same directory as the php file reading it, if that makes a difference. Perhaps fopen reads it post-parse, and I've done something wrong, but at first I was storing the hashes directly in the file, and it was working fine. After I changed it to echo the contents of the MySQL table, it bugged out.

    Read the article

  • Why is PLINQ slower than LINQ for this code?

    - by Rob Packwood
    First off, I am running this on a dual core 2.66Ghz processor machine. I am not sure if I have the .AsParallel() call in the correct spot. I tried it directly on the range variable too and that was still slower. I don't understand why... Here are my results: Process non-parallel 1000 took 146 milliseconds Process parallel 1000 took 156 milliseconds Process non-parallel 5000 took 5187 milliseconds Process parallel 5000 took 5300 milliseconds using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; namespace DemoConsoleApp { internal class Program { private static void Main() { ReportOnTimedProcess( () => GetIntegerCombinations(), "non-parallel 1000"); ReportOnTimedProcess( () => GetIntegerCombinations(runAsParallel: true), "parallel 1000"); ReportOnTimedProcess( () => GetIntegerCombinations(5000), "non-parallel 5000"); ReportOnTimedProcess( () => GetIntegerCombinations(5000, true), "parallel 5000"); Console.Read(); } private static List<Tuple<int, int>> GetIntegerCombinations( int iterationCount = 1000, bool runAsParallel = false) { IEnumerable<int> range = Enumerable.Range(1, iterationCount); IEnumerable<Tuple<int, int>> integerCombinations = from x in range from y in range select new Tuple<int, int>(x, y); return runAsParallel ? integerCombinations.AsParallel().ToList() : integerCombinations.ToList(); } private static void ReportOnTimedProcess( Action process, string processName) { var stopwatch = new Stopwatch(); stopwatch.Start(); process(); stopwatch.Stop(); Console.WriteLine("Process {0} took {1} milliseconds", processName, stopwatch.ElapsedMilliseconds); } } }

    Read the article

  • Multi-Precision Arithmetic on MIPS

    - by Rob
    Hi, I am just trying to implement multi-precision arithmetic on native MIPS. Assume that one 64-bit integer is in register $12 and $13 and another is in registers $14 and $15. The sum is to be placed in registers $10 and $11. The most significant word of the 64-bit integer is found in the even-numbered registers, and the least significant word is found in the odd-numbered registers. On the internet, it said, this is the shortest possible implementation. addu $11, $13, $15 # add least significant word sltu $10, $11, $15 # set carry-in bit addu $10, $10, $12 # add in first most significant word addu $10, $10, $14 # add in second most significant word I just wanna double check that I understand correctly. The sltu checks if the sum of the two least significant words is smaller or equal than one of the operands. If this is the case, than did a carry occur, is this right? To check if there occured a carry when adding the two most significant words and store the result in $9 I have to do: sltu $9, $10, $12 # set carry-in bit Does this make any sense?

    Read the article

  • SQL server 2008 trigger not working correct with multiple inserts

    - by Rob
    I've got the following trigger; CREATE TRIGGER trFLightAndDestination ON checkin_flight AFTER INSERT,UPDATE AS BEGIN IF NOT EXISTS ( SELECT 1 FROM Flight v INNER JOIN Inserted AS i ON i.flightnumber = v.flightnumber INNER JOIN checkin_destination AS ib ON ib.airport = v.airport INNER JOIN checkin_company AS im ON im.company = v.company WHERE i.desk = ib.desk AND i.desk = im.desk ) BEGIN RAISERROR('This combination of of flight and check-in desk is not possible',16,1) ROLLBACK TRAN END END What i want the trigger to do is to check the tables Flight, checkin_destination and checkin_company when a new record for checkin_flight is added. Every record of checkin_flight contains a flightnumber and desknumber where passengers need to check in for this destination. The tables checkin_destination and checkin_company contain information about companies and destinations restricted to certain checkin desks. When adding a record to checkin_flight i need information from the flight table to get the destination and flightcompany with the inserted flightnumber. This information needs to be checked against the available checkin combinations for flights, destinations and companies. I'm using the trigger as stated above, but when i try to insert a wrong combination the trigger allows it. What am i missing here?

    Read the article

  • preg_match_all to parse an xml-like attribute string

    - by Rob
    I have a string like so: option_alpha="value" option_beta="some other value" option_gamma="X" ...etc. I'm using this to parse them into name & value pairs: preg_match_all("/([a-z0-9_]+)\s*=\s*[\"\'](.+?)[\"\']/is", $var_string, $matches) Which works fine, unless it encounters an empty attribute value: option_alpha="value" option_beta="" option_gamma="X" What have I done wrong in my regex?

    Read the article

  • How to get Tkinter to input text and submit with button

    - by Rob
    Hi I was wondering if anybody could help me submit code from the test fields to the login fields from Tkinter import * import tkMessageBox if ( __name__ == "__main__" ): import resources.lib.mechanize as mechanize mechanize # Start Browser br = mechanize.Browser(factory=mechanize.RobustFactory()) # User-Agent (Firefox) br.addheaders = [('User-agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6')] br.open('http://razetheworld.com/wp-login.php?redirect_to=http%3A%2F%2Frazetheworld.com') br.select_form(name="loginform") br['log'] = 'entryWidget_U must enter here' br['pwd'] = 'entryWidget_P must enter here' br.submit(name="wp-submit") print br.geturl() def displayText(): """ Display the Entry text value. """ global entryWidget_U global entryWidget_P if entryWidget_U.get().strip() == "": tkMessageBox.showerror("Tkinter Entry Widget", "Enter a Username") else: tkMessageBox.showinfo("Tkinter Entry Widget", "Text value =" + entryWidget_U.get().strip()) if entryWidget_P.get().strip() == "": tkMessageBox.showerror("Tkinter Entry Widget", "Enter a Password") else: tkMessageBox.showinfo("Tkinter Entry Widget", "Text value =" + entryWidget_P.get().strip()) if __name__ == "__main__": root = Tk() root.title("Tkinter Entry Widget") root["padx"] = 40 root["pady"] = 20 # Create a text frame to hold the text Label and the Entry widget textFrame_U = Frame(root) textFrame_P = Frame(root) #Create a Label in textFrame entryLabel = Label(textFrame_U) entryLabel["text"] = "Enter Username:" entryLabel.pack(side=LEFT) entryLabel = Label(textFrame_P) entryLabel["text"] = "Enter Password:" entryLabel.pack(side=LEFT) # Create an Entry Widget in textFrame entryWidget_U = Entry(textFrame_U) entryWidget_U["width"] = 50 entryWidget_U.pack(side=LEFT) entryWidget_P = Entry(textFrame_P) entryWidget_P["width"] = 50 entryWidget_P.pack(side=LEFT) textFrame_U.pack() textFrame_P.pack() button = Button(root, text="Login", command=#Run br.submit(name="wp-submit")) button.pack() root.mainloop()

    Read the article

  • How to read and write UTF-8 to disk on the Android?

    - by Rob Kent
    I cannot read and write extended characters (French accented characters, for example) to a text file using the standard InputStreamReader methods shown in the Android API examples. When I read back the file using: InputStreamReader tmp = new InputStreamReader(in); BufferedReader reader = new BufferedReader(tmp); String str; while ((str = reader.readLine()) != null) { ... the string read is truncated at the extended characters instead of at the end-of-line. The second half of the string then comes on the next line. I'm assuming that I need to persist my data as UTF-8 but I cannot find any examples of that, and I'm new to Java. Can anyone provide me with an example or a link to relevant documentation?

    Read the article

  • "Invalid Procedure Call or Argument", but only in a compiled or P-Code EXE

    - by Rob Perkins
    I have a VB6 program which I've been maintaining for ten years. There is a subroutine in the program called "Prepare Copy", which looks like this: Public Sub PrepareCopy() Set CopiedShapes = New Collection End Sub Where CopiedShapes is dimmed out as a VB6 Collection. That code is now kicking out a Runtime Error 5 -- Invalid Procedure Call or Argument. It appears from the interstitial debugging code that the error arises between the Public Sub PrepareCopy() and the Set CopiedShapes = New Collection lines. That's right. The VB6 error is happening between two lines of my code. I can think of no other explanation for this. It's behaving this way on my development machine and two client computers. It is only happening in runtime code, and does not appear to make a difference whether I compile it or use P-Code What I'm asking for here is speculation as to what causes this sort of thing to happen.

    Read the article

  • HTTPS on iPhone

    - by Rob
    I need to be able to use https to connect to a server and I'm wondering if there's recommended way of doing this on the iPhone that's NOT: - an undocumented api call - does not require manually storing certificates in the app bundle Thanks all.

    Read the article

  • How would I create a technology standards document for my company?

    - by Rob O
    I'm a Director of Product Engineering for my company. My CEO has asked me to create a technology standards document, explaining things like the technology we use, our policy on adapting to new technology, and design standards like percent of code covered by unit tests. I've never had to do something like this, and I've spent a significant amount of time searching the web for examples, but I haven't found any at all. The closest I've found are documents describing technical specifications for an individual product. However, I'm trying to define this for the entire company. Can someone provide examples of how this document could be formatted/organized, and what the typical content would be? Thanks!

    Read the article

  • Findbugs and comparing

    - by Rob Goodwin
    I recently started using the findbugs static analysis tool in a java build I was doing. The first report came back with loads of High Priority warnings. Being the obsessive type of person, I was ready to go knock them all out. However, I must be missing something. I get most of the warnings when comparing things. Such as the following code: public void setSpacesPerLevel(int value) { if( value >= 0) { ... produces a high priority warning at the if statement that reads. File: Indenter.java, Line: 60, Type: BIT_AND_ZZ, Priority: High, Category: CORRECTNESS Check to see if ((...) & 0) == 0 in sample.Indenter.setSpacesPerLevel(int) I am comparing an int to an int, seems like a common thing. I get quite a few of that type of error with similar simple comparisons. I have alot of other high priority warnings on what appears to be simple code blocks. Am I missing something here? I realize that static analysis can produce false positives, but the errors I am seeing seem too trivial of a case to be a false positive. This one has me scratching my head as well. for(int spaces = 0;spaces < spacesPerLevel;spaces++){... Which gives the following findbugs warning: File: Indenter.java, Line: 160, Type: IL_INFINITE_LOOP, Priority: High, Category: CORRECTNESS There is an apparent infinite loop in sample.Indenter.indent() This loop doesn't seem to have a way to terminate (other than by perhaps throwing an exception). Any ideas? So basically I have a handful of files and 50-60 high priority warnings similar to the ones above. I am using findbugs 1.3.9 and calling it from the findbugs ant task

    Read the article

  • Opening txt files in Internet Explorer 8 parses some html

    - by Rob
    I'm not sure if it's just me, but whenever I open .txt files in internet explorer, it always parses the HTML, so forms, buttons, fields all show up. It does this on multiple computers, and I'm fairly sure it hasn't always done this. I know FireFox doesn't, FireFox loads it as a text file. Does anyone else have this problem? If so, have you solved it? If so again, how?

    Read the article

  • Div at bottom of window and adaptable height div

    - by Rob
    Is there a way to get a div to always be at the bottom of the window, and another div to change its height to fill any space that it leaves, and that div will scroll if its content is too long. (I never want the window to scroll). This is best illustrated by a picture: The green div will always put itself at the bottom of the window, and the orange div will fill the gap. When the window is smaller, like in the right hand image, the orange div will be smaller and will scroll. The green div can be toggled. Sometimes the green div will have display: none, and then the orange div will stretch to the bottom. When the green div has display: block again, it will look like the picture again. It has to work in IE6. So far I can get the green div to go to the bottom by: position: absolute; bottom: 0; But I don't know how to get the orange div to do what I want.

    Read the article

  • Error message when trying to insert method into touchesBegan

    - by Rob
    I am trying to create a new method within my TapDetectingImageView file and it's giving me a warning that it cannot find the method even though I have it declared in the .h file. The specific three warnings all point to the @end line in the .m file when I build it and they say: "Incomplete implementation of class 'TapDetectingImageView' ; 'Method definition for '-functionA:' not found" ; "Method definition for '-functionB:' not found" What am I missing? Am I not allowed to do this in a protocol file like TapDetectingImageView? In my .h file is: @interface TapDetectingImageView : UIImageView <AVAudioPlayerDelegate> { id <TapDetectingImageViewDelegate> delegate; } @property (nonatomic, assign) id <TapDetectingImageViewDelegate> delegate; -(void) functionA:(NSString*)aVariable; -(void) functionB:(NSString*)aVariable; @end In my .m file is: -(void)functionA:(NSString*)aVariable { // do stuff in this function with aVariable } -(void)functionB:(NSString*)aVariable { // do stuff in this function with aVariable }

    Read the article

  • What's the best way to call an IBAction from within code?

    - by Rob
    Say for instance I have an IBAction that is hooked up to a button in interface builder. - (IBAction)functionToBeCalled:(id)sender { // do something here } Within my code, say for instance in another method, what is the best way to call that IBAction? If I try to call it like this, I receive an error: [self functionToBeCalled:]; But, if I try to call it like this (cheating a bit, I think), it works fine: [self functionToBeCalled:0]; What is the proper way to call it though?

    Read the article

  • Store more than 24 hours in a DateTime

    - by Rob
    I work in a bizarre and irrational industry where we need to be able to represent the time of day as 06:00:00 to 30:00:00 instead of 0:00:00 to 24:00:00. Is there any way to do this using the DateTime type? If I try to construct a date time with an hour value greater than 24 it throws an exception.

    Read the article

  • What does this PHP (function/construct?) do, and where can I find more documentation on it?

    - by Rob
    Simple question. Here is this code. $r = rand(0,1); $c = ($r==0)? rand(65,90) : rand(97,122); $inputpass .= chr($c); I understand what it does in the end result, but I'd like a better explanation on how it works, so I can use it myself. Sorry if this is a bad question. If you're unsure of what I'm asking about, its the (function?) used here: $c = ($r==0)? rand(65,90) : rand(97,122);

    Read the article

  • Is there a Symfony callback at the termination of a session?

    - by Rob Wilkerson
    I have an application that is authenticating against an external server in a filter. In that filter, I'm trying to set a couple of session attributes on the user by using Symfony's setAttribute() method: $this->getContext()->getUser()->setAttribute( 'myAttribute', 'myValue' ); What I'm finding is that, if I dump $_SESSION immediately after setting the attribute. On the other hand, if I call getAttribute( 'myAttribute' ), I get back exactly what I put in. All along, I've assumed that reading/writing to user attributes was synonymous with reading/writing to the session, but that seems to be an incorrect assumption. Is there a timing issue? I'm not getting any non-object errors, so it seems that the user is fully initialized. Where is the disconnect here? Thanks. UPDATE The reason this was happening is because I had some code in myUser::shutdown() that cleared out a bunch of stuff. Because myUser is loosely equivalent to $_SESSION (at least with respect to attributes), I assumed that the shutdown() method would be called at the end of each session. It's not. It seems to get called at the close of each request which is why my attributes never seemed to get set. Now, though, I'm left wondering whether there's a session closing callback. Anyone know?

    Read the article

  • Expected specifier-qualifier-list before 'CGPoint'

    - by Rob
    My project compiles and runs fine unless I try to compile my Unit Test Bundle it bombs out on the following with an "Expected specifier-qualifier-list before 'CGPoint'" error on line 5: #import <Foundation/Foundation.h> #import "Force.h" @interface WorldObject : NSObject { CGPoint coordinates; float altitude; NSMutableDictionary *forces; } @property (nonatomic) CGPoint coordinates; @property (nonatomic) float altitude; @property (nonatomic,retain) NSMutableDictionary *forces; - (void)setObject:(id)anObject inForcesForKey:(id)aKey; - (void)removeObjectFromForcesForKey:(id)aKey; - (id)objectFromForcesForKey:(id)aKey; - (void)applyForces; @end I have made sure that my Unit Test Bundle is a target of my WorldObject.m and it's header is imported in my testing header: #define USE_APPLICATION_UNIT_TEST 1 #import <SenTestingKit/SenTestingKit.h> #import <UIKit/UIKit.h> #import "Force.h" #import "WorldObject.h" @interface LogicTests : SenTestCase { Force *myForce; WorldObject *myWorldObject; } @end

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >