Search Results

Search found 5 results on 1 pages for 'valli r'.

Page 1/1 | 1 

  • Find numbers that equals a sum in an array

    - by valli-R
    I want to find the first set of integers in an array X that the sum equals a given number N. For example: X = {5, 13, 24, 9, 3, 3} N = 28 Solution = {13, 9, 3, 3} Here what I have so far : WARNING, I know it uses global and it is bad,that's not the point of the question. <?php function s($index = 0, $total = 0, $solution = '') { global $numbers; global $sum; echo $index; if($total == 28) { echo '<br/>'.$solution.' = '.$sum.'<br/>'; } elseif($index < count($numbers) && $total != 28) { s($index + 1, $total, $solution); s($index + 1, $total + $numbers[$index], $solution.' '.$numbers[$index]); } } $numbers = array(5, 13, 24, 9, 3, 3); $sum = 28; s(); ?> I don't get how I can stop the process when it finds the solution.. I know I am not far from good solution.. Thanks in advance

    Read the article

  • All possibilities in 2d array

    - by valli-R
    I have this array: $array = array ( array('1', '2', '3'), array('!', '@'), array('a', 'b', 'c', 'd'), ); And I want to know all character combination of sub arrays.. for example : 1!a 1!b 1!c 1!d 1@a 1@b 1@c 1@d 2!a 2!b 2!c 2!d 2@a 2@b ... Currently I am having this code : for($i = 0; $i < count($array[0]); $i++) { for($j = 0; $j < count($array[1]); $j++) { for($k = 0; $k < count($array[2]); $k++) { echo $array[0][$i].$array[1][$j].$array[2][$k].'<br/>'; } } } It works, but I think it is ugly, and when I am adding more arrays, I have to add more for. I am pretty sure there is a way to do this recursively, but I don't know how to start/how to do it. A little help could be nice! Thanks you!

    Read the article

  • Emails going to Junk for Hotmail recipients

    - by David George
    We send daily mass emails to our customers (~30,000+ emails per day). We have problems with Hotmail users receiving our emails. Sometimes the email goes to the Junk folder, but often it will got to their inbox, but the content is blocked so the user sees a message saying "This email was blocked and may be dangerous". If an email is sent to GMAIL it is usually not blocked, but it does show up as from "Uknown" instead of the company. Please be advised I've done the following: 1. No RBLs Checked on - http://multirbl.valli.org/ 2. We do have SPF records published 3. We do have reverse DNS setup 4. Our company even signed up for the Junk Mail Reports Program at Hotmail Here is a sample header, I've noticed the X-SID-Result and the X-AUTH-Result both FAIL every time at Hotmail: X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MTtTQ0w9MQ== X-Message-Status: n:0 X-SID-Result: Fail X-AUTH-Result: FAIL X-Message-Info: JGTYoYF78jFqAaC29fBlDlD/ZI36+S6WoFmkQN10UxWFe1xLHhP+rDthGRZM87uHYM926hUBS+s0q46Yx9y6jdurhN6fx0bK Received: from privatecompany.com ([WanIPAddress]) by col0-mc3-f30.Col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 5 May 2010 08:41:27 -0700 X-AuditID: ac10fe93-000013bc00000534-46-4be191a1618e Received: from INTERNAL-Email-SERVER([InternalIPAddress]) by privatecompany.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 5 May 2010 11:41:21 -0400 From: Private Company, Inc.<[email protected]> To: [email protected] Message-Id: <[email protected]> Subject: Date: Wed, 5 May 2010 11:42:46 -0400 MIME-Version: 1.0 Reply-To: [email protected] Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: AAAAAA== Return-Path: [email protected] X-OriginalArrivalTime: 05 May 2010 15:41:27.0837 (UTC) FILETIME=[6D06E4D0:01CAEC69]

    Read the article

  • Copying Columns from Grid to Clipboard in SQL Developer

    - by thatjeffsmith
    There are several ways to get data from a query or a table|view to the clipboard. You know the tried and true, copy and paste. But what if you only want one or more columns, not every column? There are several ways to do this, let’s see if we can’t identify all of them. Write your query to only include the data you want Obvious? Yes. Needed to be said? Definitely. The best tuning tip is to only ask for the data you need, only when you absolutely need it. But let’s look at a few more practical ways to do this. Hide the unwanted columns Mouse right click on an column header. In the context menu, select ‘Columns.’ Hide the columns you don’t want. Copy and paste. WYSIWYG Grids, Hide Columns and Filter Rows Mouse select the columns Obvious, but a bit painful. For a very large dataset, you’ll be holding down the Shift and PageDown buttons – but it works. Remember to use Ctrl+Shift+C to get the column headers with the data. Use the Export Wizard This used to be called ‘Unload’ – agreed, not a great name. So, we changed it. In a grid, right mouse click on the data, and on the context menu, select ‘Export…’ Select your format – I suggest ‘delimited’ or ‘fixed’ for copying data to the clipboard. You can export to the clipboard, yes you can! Click ‘Next.’ Click in the Columns dialog, and choose the columns you want copied. Trim the columns you don't want copied Click ‘Finish.’ Alt or Ctrl tab to your window or application of choice. And Paste! "FIRST_NAME" "LAST_NAME" "Donald" "OConnell" "Douglas" "Grant" "Jennifer" "Whalen" "Pat" "Fay" "Susan" "Mavris" "William" "Gietz" "Alexander" "Hunold" "Bruce" "Ernst" "David" "Austin" "Valli" "Pataballa" "Diana" "Lorentz" "Daniel" "Faviet" "John" "Chen" "Ismael" "Sciarra" "Jose Manuel" "Urman" "Luis" "Popp" "Alexander" "Khoo" "Shelli" "Baida" "Sigal" "Tobias" "Guy" "Himuro" "Karen" "Colmenares" "Matthew" "Weiss" "Adam" "Fripp" "Payam" "Kaufling" "Shanta" "Vollman" "Kevin" "Mourgos" "Julia" "Nayer" "Irene" "Mikkilineni" ... There’s probably at least 2 or 3 more ways, but… But, try these and let me know how we can improve things. I’ve already gotten a request to be able to include the SQL text used to populate the dataset on the the copy to clipboard, and it’s now on our to-do list

    Read the article

  • applet does not load

    - by jcp
    We have a legacy program that was ported from Java 1.3 to Java 1.5. This application involves applets which worked fine before. After porting however, the applet would not load. However there are no errors or exceptions. The app would just try to load it forever. We tried to run it with Java 1.6 and poof! No problems whatsoever. Isn't Java 6 backwards compatible? So how come it would run in that version and not in 1.5? ==== Java Console log for Java 1.5.0_19 basic: Registered modality listener basic: Registered modality listener basic: Registered modality listener liveconnect: Invoking JS method: document liveconnect: Invoking JS method: document liveconnect: Invoking JS method: document liveconnect: Invoking JS method: URL liveconnect: Invoking JS method: URL liveconnect: Invoking JS method: URL basic: Referencing classloader: sun.plugin.ClassLoaderInfo@bb7759, refcount=1 basic: Referencing classloader: sun.plugin.ClassLoaderInfo@bb7759, refcount=2 basic: Referencing classloader: sun.plugin.ClassLoaderInfo@bb7759, refcount=3 basic: Added progress listener: sun.plugin.util.GrayBoxPainter@b0bad7 basic: Loading applet ... basic: Initializing applet ... basic: Starting applet ... basic: Added progress listener: sun.plugin.util.GrayBoxPainter@ba9340 basic: Added progress listener: sun.plugin.util.GrayBoxPainter@1198891 basic: Loading applet ... basic: Initializing applet ... basic: Starting applet ... basic: Loading applet ... basic: Initializing applet ... basic: Starting applet ... basic: Referencing classloader: sun.plugin.ClassLoaderInfo@bb7759, refcount=4 basic: Releasing classloader: sun.plugin.ClassLoaderInfo@bb7759, refcount=3 basic: Referencing classloader: sun.plugin.ClassLoaderInfo@bb7759, refcount=4 basic: Releasing classloader: sun.plugin.ClassLoaderInfo@bb7759, refcount=3 basic: Referencing classloader: sun.plugin.ClassLoaderInfo@bb7759, refcount=4 basic: Releasing classloader: sun.plugin.ClassLoaderInfo@bb7759, refcount=3 network: Connecting <something>.jar with proxy=HTTP @ proxy/<ip address> basic: Loading <something>.jar from cache basic: No certificate info, this is unsigned JAR file. Left START init() Left END init() Right START init() Control start() Waiting for Left Panel to load... Right START start() network: Connecting socket://<ip address>:14444 with proxy=DIRECT Control start() Waiting for Left Panel to load... Control start() Waiting for Left Panel to load... Control start() Waiting for Left Panel to load... my HostName : <ip address> Thread-19 Check : Thread-19 Check : Monitor : run : start Thread-20 Monitor : Monitor: run() start Control start() Waiting for Left Panel to load... Control start() Waiting for Left Panel to load... Control start() Waiting for Left Panel to load... Control start() Waiting for Left Panel to load... Control start() Waiting for Left Panel to load... Control start() Waiting for Left Panel to load... the last message goes on forever... and now with the working version: ==== Java Console log for Java 1.6.0_15 basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@1b000e7 basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@12611a7 basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@1807ca8 network: CleanupThread used 6 us network: CleanupThread used 5 us network: CleanupThread used 6 us cache: Skip blacklist check as cached value is ok. network: Cache entry found [url: <something>.jar, version: null] network: Connecting <something>.jar with proxy=HTTP @ proxy/<ip address> network: ResponseCode for <something>.jar : 304 network: Encoding for <something>.jar : null network: Disconnect connection to <something>.jar Reading certificates from 11 <something>.jar | <something>.idx network: No certificate info for unsigned JAR file: <something>.jar basic: Applet loaded. basic: Applet loaded. basic: Applet resized and added to parent container basic: Applet resized and added to parent container basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 330275 us, pluginInit dt 27768955 us, TotalTime: 28099230 us Right START init() basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 330275 us, pluginInit dt 27770563 us, TotalTime: 28100838 us Left START init() basic: Applet loaded. basic: Applet resized and added to parent container basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 330275 us, pluginInit dt 27779332 us, TotalTime: 28109607 us Left END init() basic: Applet initialized basic: Removed progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@12611a7 basic: Applet made visible And that's it. Still haven't figured out why it works with java6 and not java5. @valli: the object tag was used, not applet @thorbjorn: i tried that already... it just keeps saying loading applet... @aaron: how can i know what exception it is, if there really is one? and yes we have considered that its a java bug but i still havent found what that bug is. i have to submit a report tomorrow and i've scoured the net but came up with nothing as of yet... @all: thank you for your replies

    Read the article

1