Search Results

Search found 1119 results on 45 pages for 'robert birch'.

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

  • INSERT 0..n records into table 'A' based on content of table 'B' in MySql 5

    - by Robert Gowland
    Using MySql 5, I have a task where I need to update one table based on the contents of another table. For example, I need to add 'A1' to table 'A' if table 'B' contains 'B1'. I need to add 'A2a' and 'A2b' to table 'A' if table 'B' contains 'B2', etc.. In our case, the value in table 'B' we're interested is an enum. Right now I have a stored procedure containing a series of statements like: INSERT INTO A SELECT 'A1' FROM B WHERE B.Value = 'B1'; --Repeat for 'B2' -> 'A2a'; 'B2' -> 'A2b'; 'B3' -> 'A3', etc... Is there a nicer more DRY way of accomplishing this? Edit: There may be values in table 'B' that have no equivalent value for table 'A'.

    Read the article

  • An RMIPRoxyFactoryBean factory in Spring?

    - by Robert Munteanu
    I'm currently using a Spring RmiProxyFactoryBean to access remote services. Since requirements have changed, I need to specify at runtime a different host - there can be many of them - , but the remoteServiceInterface and the non-host components of the remoteServiceUrl remain the same. Conceptually speaking, I'd see a bean definition similar to: <bean class="org.springframework.remoting.rmi.RmiProxyFactoryBeanFactory"> <property name="serviceInterface" value="xxx"/> <property name="serviceUrl" value="rmi://#{HOST}:1099/ServiceUrl"/> </bean> which exposes a Object getServiceFor(String hostName); Is there such a service available with Spring? Alternatively, do you see another way of doing this? Please note that the host list will not be known at compile or startup time, so I can't generate it in the xml file.

    Read the article

  • upload multiple images, display thumbnails, manipulate image

    - by robert
    hy, i need a little help here i want to be able to upload multiple images after i upload all i want to display thumbnails, when i click on a thumb i want to be able to rotate the image (rotate the original image not only the thumb) All uploaded images i want to be in one php array, in the order they have been uploaded. Or if i can to change the order of the images, i know is possible with jQuery! how i can code this?? i started but i can't get this done! here is my project so far: http://www.mediafire.com/?3uzzgx5onzn any help is welcome! Thanks!

    Read the article

  • returning a Void object

    - by Robert
    What is the correct way to return a Void type, when it isn't a primitive? Eg. I currently use null as below. interface B<E>{ E method(); } class A implements B<Void>{ public Void method(){ // do something return null; } }

    Read the article

  • Exploding a range of dates with LINQ

    - by Robert Gowland
    If I have a pair of dates, and I want to generate a list of all the dates between them (inclusive), I can do something like: System.DateTime s = new System.DateTime(2010, 06, 05); System.DateTime e = new System.DateTime(2010, 06, 09); var list = Enumerable.Range(0, (e - s).Days) .Select(value => s.AddDays(value)); What I'm stuck on is that I've got a list of pairs of dates that I want to explode into a list of all the dates between them. Example: {2010-05-06, 2010-05-09}, {2010-05-12, 2010-05-15} should result in {2010-05-06, 2010-05-07, 2010-05-08, 2010-05-09, 2010-05-12, 2010-05-13, 2010-05-14, 2010-05-15} Note the pairs of dates are guaranteed not to overlap each other.

    Read the article

  • How can I construct this file tree based on what files the user is allowed to view?

    - by robert
    I have an array of files that looks like this: Array ( [0] => Array ( [type] => folder [path] => RootFolder ) [1] => Array ( [type] => file [path] => RootFolder\error.log ) [2] => Array ( [type] => folder [path] => RootFolder\test ) [3] => Array ( [type] => file [path] => RootFolder\test\asd.txt ) [4] => Array ( [type] => folder [path] => RootFolder\test\sd ) [5] => Array ( [type] => file [path] => RootFolder\test\sd\testing.txt ) ) I parse this array and create a tree like view based on the depth of the files ('/' count). It looks like this: RootFolder - error.log - test - asd.txt - sd - testing.txt What I have now is an array of filepaths the user is allowed to view. I need to take this array into account when constructing the above tree. That array looks like this: Array ( [0] => Array ( [filePath] => RootFolder\test\sd ) [1] => Array ( [filePath] => RootFolder\error.log ) ) It would be easy to do a if in_array($path, $allowed) but that won't give me the tree. Just a list of files... Another part I'm stumped on is this requirement: If the user has access to view the folder test, they then have access to all children of that folder. My idea was to simply parse the filepaths. For example, I'd confirm that RootFolder\test\sd was a directory and then create a tree based on the '/' count. Like I was doing earlier. Then, since this is a directory, I'd pull out all files within this directory and show them to the user. However, I'm having trouble converting this to working code... Any ideas?

    Read the article

  • Disable Products in different Magento Store Views

    - by Robert
    I have a Magento Multi-Store installation (not multi-site) and some products are available in more than one store. However, these products that are available in, let's say storeA and storeB, have related products, BUT, the related products are not available in both stores. The problem is this, Product1, which has Product2, Product3, and Product4 as related products, appears in storeA. No Problem. Product1 is also available in storeB, but NOT Product2-3-4. However, those products, though not shown in the general catalog of storeB, are visible as related products to Product1 in storeB. If I use the drop down to manage products in storeB, and I remove the related products in Product1, it removes the related products from Product1 in storeA, where they should be available. I cannot change the status attribute to storeview in Manage Attributes, because the only choices are Global or Website, not Store View. I can change the skin to show UPSELL products instead, and set up different UPSELL products, but that limits my stores to only two. Any ideas?

    Read the article

  • A question on getting number of nodes in a Binary Tree

    - by Robert
    Dear all, I have written up two functions (pseudo code) for calculation the number of nodes and the tree height of a Binary Tree,given the root of the tree. Most importantly,the Binary Tree is represented as the First chiled/next sibling format. so struct TreeNode { Object element; TreeNode *firstChild; TreeNode *nextSibling; } Calculate the # of nodes: public int countNode(TreeNode root) { int count=0; while(root!=null) { root= root.firstChild; count++; } return count; } public int countHeight(TreeNode root) { int height=0; while(root!=null) { root= root.nextSibling; height++; } return height; } This is one of the problem I saw on an algorithm book,and my solution above seems to have some problems,also I didn't quite get the points of using this First Child/right sibling representation of Binary Tree,could you guys give me some idea and feedback,please? Cheers!

    Read the article

  • Testing for a closed socket

    - by Robert S. Barnes
    I'm trying to test for a closed socket that has been gracefully closed by the peer without incurring the latency hit of a double send to induce a SIGPIPE. One of the assumptions here is that the socket if closed was gracefully closed by the peer immediately after it's last write / send. Actual errors like a premature close are dealt with else where in the code. If the socket is still open, there will be 0 or more bytes data which I don't actually want to pull out of the socket buffer yet. I was thinking that I could call int ret = recv(sockfd, buf, 1, MSG_DONTWAIT | MSG_PEEK); to determine if the socket is still connected. If it's connected but there's no data in the buffer I'll get a return of -1 with errno == EAGAIN and return the sockfd for reuse. If it's been gracefully closed by the peer I'll get ret == 0 and open a new connection. I've tested this and it seems to work. However, I suspect there is a small window between when I recv the last bit of my data and when the peer FIN arrives in which I could get a false-positive EAGAIN from my test recv. Is this going to bite me, or is there a better way of doing this?

    Read the article

  • Simple MultiThread Safe Log Class

    - by Robert
    What is the best approach to creating a simple multithread safe logging class? Is something like this sufficient? public class Logging { public Logging() { } public void WriteToLog(string message) { object locker = new object(); lock(locker) { StreamWriter SW; SW=File.AppendText("Data\\Log.txt"); SW.WriteLine(message); SW.Close(); } } }

    Read the article

  • ORACLE:- 'SELECT ORDER BY ASC' but 'USA' always first.

    - by Robert
    I have to write a drop down query for countries. But USA should always be first. The rest of the countries are in alphabetical order I tried the following query SELECT countries_id ,countries_name FROM get_countries WHERE countries_id = 138 UNION SELECT countries_id ,countries_name FROM get_countries WHERE countries_id != 138 ORDER BY 2 ASC

    Read the article

  • Create Registry Value In Local Machine Using C#

    - by Robert
    I'm trying to save an install path to the registry so my windows service will know where my other application was installed. I'm using visual studio's deployment to create a registry value in HKEY_CURRENT_USER, but my windows service which runs under LocalMachine doesn't have access to that. I then made the installer create a registry value in HKEY_LOCAL_MACHINE, but when I view the registry after the install it appears it never made the value. Any ideas?

    Read the article

  • Echo-ing Only Available Database Result

    - by Robert Hanson
    I have this Associative Array : $Fields = array("row0"=>"Yahoo ID", "row1"=>"MSN ID", "row2"=> "Gtalk ID"); on the other side, I have this SQL query : SELECT YahooID, MSNID, GTalkID From UserTable WHERE Username = '$Username' LIMIT 1; the result maybe vary, because some users only have Yahoo ID and some have others. for example if I have this result : $row[0] = NONE //means YahooID = NONE $row[1] = [email protected] $row[2] = [email protected] then how to have this as an output (echo) : MSN ID = [email protected] Gtalk ID = [email protected] since Yahoo ID is not exist, then the result will be MSN and Gtalk only. 'MSN ID' and 'Gtalk ID' is variable from Associative Array, while '[email protected]' and '[email protected]' from SQL result. thanks!

    Read the article

  • Objective C memory management question with NSArray

    - by Robert
    I am loading an array with floats like this: NSArray *arr= [NSArray arrayWithObjects: [NSNumber numberWithFloat:1.9], [NSNumber numberWithFloat:1.7], [NSNumber numberWithFloat:1.6], [NSNumber numberWithFloat:1.9],nil]; Now I know this is the correct way of doing it, however I am confused by the retail counts. Each Object is created by the [NSNumber numberWithFloat:] method. This gives the object a retain count of 1 dosnt it? - otherwise the object would be reclaimed The arrayWithObjects: method sends a retain message to each object. This means each object has a retain cont of 2. When the array is de-allocated each object is released leaving them with a retain count of 1. What have I missed?

    Read the article

  • C# - Listing class properties like Immediate window

    - by Robert
    Hi, I store a few classes in session. I want to be able to see the values of my class properties in trace viewer. By default I only the Type name MyNamespace.MyClass. I was wondering if I overwrite the .ToString() method and use reflection to loop over all the properties and construct a string like that ... it would do the trick but just wanted to see if there is anything already out there (specially since Immediate Window has this capability) which does the same ... i.e. list the class property values in trace instead of just the Name of the class. Thanks!

    Read the article

  • How do I hide an HTML element before the page loads

    - by Robert
    I have some JQuery code that shows or hides a div. $("div#extraControls").show(); // OR .hide() I initially want the div to be not visible so I used: $(document).ready(function() { $("div#extraControls").hide(); }); However, on the browser, the content loads visible for a second before disappearing, which is not what I want. How do I set the hide the element before the page loads whilst keeping the ability to show hide it dynamically with a script?

    Read the article

  • Should I use more than one CSS sheet?

    - by Robert
    I am updating a website to add some mobile friendly pages. At the moment we have one big css page with everything in. My idea is to put all the mobile specific css into a separate file and then link both sheets. The mobile css will overide anything in the default css (bigger buttons etc). Im quite new to css, what is the best practice?

    Read the article

  • [Perl] Use a Module / Object which is defined in the same file

    - by Robert S. Barnes
    I need to define some modules and use them all in the same file. No, I can't change the requirement. I would like to do something like the following: { package FooObj; sub new { ... } sub add_data { ... } } { package BarObj; use FooObj; sub new { ... # BarObj "has a" FooObj my $self = ( myFoo => FooObj->new() ); ... } sub some_method { ... } } my $bar = BarObj->new(); However, this results in the message: Can't locate FooObj.pm in @INC ... BEGIN failed... How do I get this to work?

    Read the article

  • How do I constrain a container's height to the height of a specific content element?

    - by Robert Rossney
    I'm trying to do something which seems like it should be extremely simple and yet I can't see how. I have a very simple layout, a TextBox with an image next to it, similar to the way it might look adorned with an ErrorProvider in a WinForms application. The problem is, I want the image to be no higher than the TextBox it's next to. If I lay it out like this, say: <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <TextBox Grid.Row="0" Grid.Column="0" MinWidth="100"/> <Image Grid.Row="0" Grid.Column="1" Source="error.png" /> </Grid> the row will size to the height of the image if the image is taller than the TextBox. This also happens if I use a DockPanel or StackPanel. The naive solution would be to bind the Height to the TextBox's ActualHeight. I'm sure this is wrong. But what's right?

    Read the article

  • How to determine which version of Oracle Client is being used from the server.

    - by Robert Love
    Using Oracle 10g. ( 10.2.0.4 ) Possibly by looking at either logs or system tables is there a way to determine which version of the oracle client each connection is using. Our systems initially had 8.1.7 Clients, and then 9.X clients. We attempted to manually locate all machines that had older clients and upgrade them to to 10.2 Clients. We are seeking a method to audit (from the server) if we were successful in upgrading all of our client machines.

    Read the article

  • Copy existing XML, duplicate element and modify

    - by Robert
    Hi, I have a tricky XSL problem at the moment. I need to copy the existing XML, copy a certain element (plus its child elements) and modify the value of two child-elements. The modifications are: divide value of the 'value' element by 110 and edit the value of the 'type' element from 'normal' to 'discount'. This is currently what I have: Current XML: <dataset> <data> <prices> <price> <value>50.00</value> <type>normal</type> </price> </prices> </data> </dataset> Expected result <dataset> <data> <prices> <price> <value>50.00</value> <type>normal</type> </price> <price> <value>45.00</value> <type>discount</type> </price> </prices> </data> </dataset> Any takers? I've gotten as far as copying the desired 'price' element using copy-of, but I'm stuck as to how to modify it next.

    Read the article

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