Search Results

Search found 1689 results on 68 pages for 'andrew 1510'.

Page 57/68 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • Determining whether one array contains the contents of another array in ruby

    - by Andrew Grimm
    In ruby, how do I test that one array not only has the elements of another array, but contain them in that particular order? correct_combination = [1, 2, 3, 4, 5] [1, 5, 8, 2, 3, 4, 5].function_name(correct_combination) # => false [8, 10, 1, 2, 3, 4, 5, 9].function_name(correct_combination) # => true I tried using include, but that is used to test whether [1,2,3].include?(2) is true or not.

    Read the article

  • Virtualhost subdomain Internal Server Error

    - by Andrew
    I am trying to set up user generated sub domains for my PHP application. When I go to sub.domain.com and if I upload an index.html file it works fine, however if I use index.php it gives me a "Internal Server Error 500" message I have done the steps below to get subdomains working STEP 1: Edited my DNZ zone file and appended *.domain.com. IN A 91.111.111.111 STEP 2: Appended to httpd.conf the following: <VirtualHost 91.111.111.111:80> ServerName domain.com ServerAlias *.domain.com DocumentRoot /home/domain/public_html/sub <Directory "/home/domain/public_html/sub"> Options -Indexes Options FollowSymLinks AllowOverride All </Directory> </VirtualHost> Step 3: Tested by uploading an index.html file to the document directory in step 2, and works fine. Tried with an index.php gives a internal server error and then I looked into Apache error log and shows error for a redirect loop more than 10 times Update: getting this error: No user or group set - set suPHP_UserGroup Any ideas why I can not use any .php file in the directory?

    Read the article

  • Caching result of SELECT statement for reuse in multiple queries

    - by Andrew
    I have a reasonably complex query to extract the Id field of the results I am interested in based on parameters entered by the user. After extracting the relevant Ids I am using the resulting set of Ids several times, in separate queries, to extract the actual output record sets I want (by joining to other tables, using aggregate functions, etc). I would like to avoid running the initial query separately for every set of results I want to return. I imagine my situation is a common pattern so I am interested in what the best approach is. The database is in MS SQL Server and I am using .NET 3.5.

    Read the article

  • User Interface. Multiple select with priority.

    - by Andrew Florko
    I'm designing user interface and want to ask your advises how to make it more user-friendly. Please tell any suggestions and if you have ever seen implementation of something familiar please share the link. University. There are 40+ specialities grouped into 5 faculties. User choose several he is interested in and than orders them by priority. For example I am interested in "programming microcontrollers", "system analysis" and "experimental physic". I must find them quickly in "programming faculty", select them and then order - what I prefer most and what I prefer less then others I select. Any ideas welcome :)

    Read the article

  • In which document do file specifications belong?

    - by Andrew
    In which document would a file specification belong? Perhaps this file is used as an input to a third-party system. Would it belong in its own document? Or would it be better to put it in the functional or design spec? Or somewhere else? When I say file specification, I mean a description of what format the file is (CSV, fixed width, etc), columns, data types, etc. Also, where should you document how the file is generated? i.e. business rules/algorithms which are used to generate the file.

    Read the article

  • Bulk update & occasional insert (coredata) - Too slow

    - by Andrew
    Update: Currently looking into NSSET's minusSet links: http://stackoverflow.com/questions/1475636/comparing-two-arrays Hi guys, Could benefit from your wisdom here.. I'm using Coredata in my app, on first launch I download a data file and insert over 500 objects (each with 60 attributes) - fast, no problem. Each subsequent launch I download an updated version of the file, from which I need to update all existing objects' attributes (except maybe 5 attributes) and create new ones for items which have been added to the downloaded file. So, first launch I get 500 objects.. say a week later my file now contains 507 items.. I create two arrays, one for existing and one for downloaded. NSArray *peopleArrayDownloaded = [CoreDataHelper getObjectsFromContext:@"person" :@"person_id" :YES :managedObjectContextPeopleTemp]; NSArray *peopleArrayExisting = [CoreDataHelper getObjectsFromContext:@"person" :@"person_id" :YES :managedObjectContextPeople]; If the count of each array is equal then I just do this: NSUInteger index = 0; if ([peopleArrayExisting count] == [peopleArrayDownloaded count]) { NSLog(@"Number of people downloaded is same as the number of people existing"); for (person *existingPerson in peopleArrayExisting) { person *tempPerson = [peopleArrayDownloaded objectAtIndex:index]; // NSLog(@"Updating id: %@ with id: %@",existingPerson.person_id,tempPerson.person_id); // I have 60 attributes which I to update on each object, is there a quicker way other than overwriting existing? index++; } } else { NSLog(@"Number of people downloaded is different to number of players existing"); So now comes the slow part. I end up using this (which is tooooo slow): NSLog(@"Need people added to the league"); for (person *tempPerson in peopeArrayDownloaded) { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"person_id = %@",tempPerson.person_id]; // NSLog(@"Searching for existing person, person_id: %@",existingPerson.person_id); NSArray *filteredArray = [peopleArrayExisting filteredArrayUsingPredicate:predicate]; if ([filteredArray count] == 0) { NSLog(@"Couldn't find an existing person in the downloaded file. Adding.."); person *newPerson = [NSEntityDescription insertNewObjectForEntityForName:@"person" inManagedObjectContext:managedObjectContextPeople]; Is there a way to generate a new array of index items referring to the additional items in my downloaded file? Incidentally, on my tableViews I'm using NSFetchedResultsController so updating attributes will call [cell setNeedsDisplay]; .. about 60 times per cell, not a good thing and it can crash the app. Thanks for reading :)

    Read the article

  • Is this possible with sql?

    - by Andrew
    Is it possible to do something like this: INSERT INTO table(col1, col2) VALUES(something_from_another_table, value); With something_from_another_table being a SQL command? Like, is there something I can do that's equivelant to: INSERT INTO table(col1, col2) VALUES((SELECT value FROM table2 WHERE id = 3), value);

    Read the article

  • Align text with bottom as it comes in during a chat?

    - by Andrew
    I'm building a custom web chat application, and while I have the basics worked out, I've been wondering if this was possible... right now, the chat comes in at the top of the div, and when it reaches the bottom, the div starts scrolling. This works. This is great. But I was wondering if it was possible to create it more like an IRC client, where the chat comes in initially at the bottom of the div, then each new line comes in below the old ones, etc, and again, when the div is full, it starts scrolling. I've managed to get part of this working: I can get it displaying this way. But I can't find a way to scroll it; either the scroll doesn't appear (when there's no overflow on the inner, text div, despite there being an overflow on the outer, container div), or it's confined to the width of the text rather than the width of the container div. Some options I've tried: <div id="chatbox" style="overflow: auto; position: relative; width: 100%; height: 400px;"> <div id="chatmessages" style="overflow: auto; position: absolute; bottom: 0;"></div></div> This has the text appear properly at the bottom, but no scrollbar ever appears. <div id="chatbox" style="overflow: auto; position: relative; width: 100%; height: 400px;"> <div id="chatmessages" style="overflow: scroll; position: absolute; bottom: 0;"></div></div> This has the text appear properly at the bottom, and a scrollbar appears, but it's only ever as wide as the text, even if width=100%... and when the text reaches the top, the scrollbar remains gray. Basically, do I want the scrollbar on the inner or the container div, is this even possible, how do I force it to work, and am I going about this entirely wrong?

    Read the article

  • How to implement a search page which shows results on the same page?

    - by Andrew
    I'm using ASP.NET MVC 2 for the first time on a project at work and am feeling like a bit of a noob. I have a page with a customer search control/partial view. The control is a textbox and a button. You enter a customer id into the textbox and hit search. The page then "refreshes" and shows the customer details on the same page. In other words, the customer details appear below the customer search control. This is so that if the customer isn't the right one, the user can search again without hitting back in the browser. Or, perhaps they mistyped the customer id and need to try again. I want the URL to look like this: /Customer/Search/1 Obviously, this follows the default route in the project. Now, if I type the URL above directly into my browser, it works fine. However, when I then use the search control on that page to search for say customer 2, the page refreshes with the correct customer details but the URL does not change! It stays as /Customer/Search/1 When I want it to be /Customer/Search/2 How can I get it to change to the correct URL? I am only using the default route in Global.asax. My Search method looks like this: <AcceptVerbs(HttpVerbs.Get)> _ Function Search(ByVal id As String) As ActionResult Dim customer As Customer = New CustomerRepository().GetById(id) Return View("SearchResult", customer) End Function

    Read the article

  • How bad is it to embed JavaScript into the body of HTML?

    - by Andrew
    A team that I am working on has gotten into the habit of using <script> tags in random places in the body of our HTML pages. For example: <html> <head></head> <body> <div id="some-div"> <script type="text/javascript">//some javascipt here</script> </div> </body> </html> I had not seen this before. It seems to work in the few browsers that I've tested. But as far as I know, it's not valid to put script tags in places like this. Am I wrong? How bad is it that we are putting script tags within div tags like this? Are there any browser compatibility issues I should be aware of?

    Read the article

  • JQUERY: Multiplying input elements select box and radio boxes and hidden inputs

    - by Andrew Tan
    Evening, I'm tyring to multiply different input elements but for some reason it's giving me a NAND error. As the user selects, check or modify the values of any element. This should change the total amount. http://jsfiddle.net/aQ5K8/ <select name="select"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <input name="radio" type="radio" id="radio" value="10" tvalue="100" /> <input name="radio" type="radio" id="radio" value="20" tvalue="200" /> <label id="Total"></label> Also if you take a look at the jsfiddle code i have tvalue=100 and the other is =200 as a custom attributes, how would I access that instead of accessing the regular html value. Thank you.

    Read the article

  • Javascipt or jQuery "Are you sure?" dialog for <A> link?

    - by Andrew Tomazos - Fathomling
    I have a link in my HTML: <a href="/DoSomethingDangerous">do something dangerous</a> Visiting the DoSomethingDangerous link causes a not easily reversable action to occur. So after the link is clicked on I would like a dialog box (eg "Are you sure?" "OK" "Cancel") to be displayed and if the user clicks Cancel the link is not visited and the browser remains at the same page. What is the cleanest technique using either Javascript or jQuery to implement this?

    Read the article

  • Multiple Apps Possible via Launch Services, want to Specify Particular One

    - by Andrew
    Here's the issue: I have a list of App names that I want to launch. They do not include a path (e.g. {"VLC","Microsoft Word"}. I have two different copies of VLC in different directories. I would like Launch Services to ONLY open the one from /Applications/ and not EVER launch from /Applications/AnotherDirectory I want to get the path of these, and test to see what Launch Services wants to launch (via bash with "open" or applescript via "tell _ to launch" or [NSWorkspace launch...]) The only way that I have come up with to test the path of a file about to be launched by launch services is: Applescript: tell application "Finder" to return the (posix path of (path to application "VLC" as alias)) That works fine, but launches the app (which I don't want at all). Suggestions?

    Read the article

  • Updating DIV with XML content on Hover (JQuery)

    - by Andrew Parisi
    Hi everyone! The concept of what I'm trying to do is fairly simple. I have a grid of company logos loaded through XSLT from an XML document, each with their own unique links to the company profiles. I have a separate div on the page, essentially a "preview" box. What I want to do is this: I roll over a logo, and it loads the name of the company and a short description into the preview div. This content is loaded through XML. I have been messing around with the Jquery load() function, changing the target document to load on Hover—and it almost gets what I want, but it loads the whole target XML document into the div. How can I separate this target XML data into separate divs? (which I have styled differently) I'd assume I would make use of Ajax in some way. I want to load the <name> node into the name_div, and the <desc> node into the description_div, and have them update on hover. Thanks in advance for the help!

    Read the article

  • Output error in comparing characters from two strings

    - by Andrew Martin
    I'm stuck with my a piece of code I'm creating. My IDE is Eclipse and when I use its debugging feature, to trace what's happening on each line, it outputs perfectly. However, when I click the "run" project, it just outputs a blank screen: public static void compareInterests(Client[] clientDetails) { int interests = 0; for (int p = 0; p < numberOfClients; p++) { for (int q = 0; q < numberOfClients; q++) { String a = clientDetails[p].getClientInterests(); String b = clientDetails[q].getClientInterests(); int count = 0; while (count < a.length()) { if (a.charAt(count) == b.charAt(count)) interests++; count++; } if ((interests >= 3) && (clientDetails[p].getClientName() != clientDetails[q].getClientName())) System.out.print (clientDetails[p].getClientName() + " is compatible with " + clientDetails[q].getClientName()); interests = 0; } } } The code is designed to import an object array which contains information on a client's name and a client's interests. The client's interests are stored in the format "01010", where each 1 means they are interested in that activity, each 0 means they are not. My code compares each character of every client's string with every other client's string and outputs the results for all client's that don't have the same name and have three or more interests in common. When I run this code through Java's debugger, it outputs fine - but when I click run project or compile, I just get a blank screen. Any ideas?

    Read the article

  • x86 Instruction Format: "ba 0e 00 00 00" ... "mov $0xe,%edx"

    - by Andrew Tomazos - Fathomling
    I'm getting the following line in the disassembly from objdump -d of an x86 linux program... 4000b0: ba 0e 00 00 00 mov $0xe,%edx I'm trying to understand how the machine code "ba 0e 00 00 00" maps to "mov $0xe,%edx" In the manual move immediate 32-bit is: B8 + rd ... MOV r32, imm32 ie "B8" not "BA" In fact none of the MOV opcodes are "BA". If someone could break down "ba 0e 00 00 00" and explain bit-wise how to get to "mov $0xe,%edx" it would be most helpful.

    Read the article

  • What considerations should be made when creating a reporting framework for a business?

    - by Andrew Dunaway
    It's a pretty classic problem. The company I work for has numerous business reports that are used to track sales, data feeds, and various other metrics. Of course this also means that there is a conglomerate of disparate frameworks, ASP.net pages, and areas where these reports can be found. There have been some attempts at consolidating these into a single entity, but nothing has stuck yet. Since this is a common problem, and I am sure solved innumerable times, I wanted to see what others have done. For the most part these can be boiled down to the following pieces: A SQL query against our database to gather data A presentation of data, generally in a data grid Filtering that can vary based on data types and the business needs Some way to organize the reports, a single drop down gets long and unmanageable quickly A method to download data to alter further, perhaps a csv file My first thought was to create a framework in Silverlight with Linq to Sql. Mainly just because I like it and want to play with it which probably is not the best reason. I also thought the controls grant a lot of functionality like sorting, dragging columns, etc. I was also curious about the printing in Silverlight 4. Which brings me around to my original question, what is the best way to do this? Is there a package out there I can just buy that will do it for me? The Silverlight approach seems pretty easy, after it's setup and templated, but maybe it's a bad idea and I can learn from someone else?

    Read the article

  • MySQL: How to copy rows, but change a few fields?

    - by Andrew
    I have a large number of rows that I would like to copy, but I need to change one field. I can select the rows that I want to copy: select * from Table where Event_ID = "120" Now I want to copy all those rows and create new rows while setting the Event_ID to 155. How can I accomplish this?

    Read the article

  • How to use vertical-align: middle; properly?

    - by Andrew
    I want to have my list (nav) align to the center of an image (logo). I tried using vertical-align: middle;, but I couldn't get it to work when I floated the images left and right. Here's my code: HTML: <div id="head"> <img id="logo" src="logo.png" /> <ul id="nav"> <li><a href="#">Item 1</a></li> <li><a href="#">Item 2</a></li> <li><a href="#">Item 3</a></li> </ul> </div> CSS: #head { margin-top: 2px; width: 100%; } #logo { float: left; } ul#nav { float: right; } ul#nav li { display: inline; list-style-type: none; } I took all the vertical-align: middle;'s from where I put them (I tested it in each element, even though it was only supposed to be applied to #logo, from what I've read.) Anyways, any help would be appreciated.

    Read the article

  • WPF DropShadowEffect in ListBox

    - by Andrew
    Hi, Basically, I have a listbox which contains a set of listboxitem (stacked horizontally). On selected listboxitem, there will be dropshadoweffect applied to the border of the listboxitem. The problem i am having at the moment is the dropshadopeffect on the left hand side is covering (on top of) the left listboxitem. This is fine for me, however the dropshadoweffect on the right hand side of the listboxitem is covered by (below) the right listboxitem. Is there a way to make them consistent? so that both sides' dropshadoweffect will appear on top of the left and right listboxitems. Please let me know if you need more information. Any help would be appreciated.

    Read the article

  • Win32_Product InstallLocation (error)

    - by andrew
    in C#, i'm trying to get some properties from the instances of Win32_Product, but i seem to have an error saying "Object reference not set to an instance of an object." here's the code: class Package { public string productName; public string installDate; public string installLocation; } class InstalledPackages { public static List<Package> get() { List<Package> packages = new List<Package>(); string query = "SELECT * FROM Win32_Product"; ManagementScope oMs = new ManagementScope(); ObjectQuery oQuery = new ObjectQuery(query); ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oMs, oQuery); ManagementObjectCollection installedPackages = oSearcher.Get(); foreach (ManagementObject package in installedPackages) { Package p = new Package(); p.productName = package["Name"].ToString(); p.installLocation = package["InstallLocation"].ToString(); p.installDate = package["InstallDate"].ToString(); packages.Add(p); } return packages; } } the exception appears when it gets to p.installLocation = package["InstallLocation"].ToString(); also, i get one if i try to do p.installLocation = package["InstallDate2"].ToString(); if i'm asking for InstallDate it works. (i'm using Windows 7 Ultimate x64)

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >