Reg : Knapsack problem - [Off Topic] -

Hi All,
Few days back, there was a post which was a practical implementation of the 'Knapsack Problem'.
And, I remember somebody actually posted a query which solved this.
Can anybody please give me the link for it?
Or, if have the query?
I searched the OTN but not getting the post.
Thanks.
Ranit B.

SQL isn't the best tool for the task, but.... And there are many variations of knapsack task. Anyway, below is combination (MODEL + hierarchical) solution I posted on one of SQL forums while back for the following knapsack task:
There are n items. We know weight and cost of each item. Task is to fill knapsack with items so that total weight doesn't exceed knapsack weight capacity and get max possible total cost.
DROP TABLE knapsack PURGE;
CREATE TABLE knapsack(
                      item_number NUMBER PRIMARY KEY,
                      volume      NUMBER NOT NULL,
                      value       NUMBER NOT NULL
INSERT INTO knapsack VALUES(1, 77, 2);
INSERT INTO knapsack VALUES(2, 99, 1);
INSERT INTO knapsack VALUES(3, 19, 3);
INSERT INTO knapsack VALUES(4, 91, 1);
INSERT INTO knapsack VALUES(5,  6, 3);
INSERT INTO knapsack VALUES(6,  6, 1);
INSERT INTO knapsack VALUES(7,  3, 1);
INSERT INTO knapsack VALUES(8, 92, 6);
COMMIT;
VARIABLE capacity NUMBER;
EXEC :capacity := 92;
SELECT  'Will take items ' ||
          regexp_replace(
                         trim(sys_connect_by_path(case max_item_mask when 0 then null else item_number end,' ')),
                         ' +',
                        ) ||
          '. Total value will be ' || max_total_value || ' (' ||
          regexp_replace(
                         trim(sys_connect_by_path(case max_item_mask when 0 then null else value end,' ')),
                         ' +',
                         '+'
                        ) ||
          '). Total volume will be ' || max_total_volume || ' (' ||
          regexp_replace(
                         trim(sys_connect_by_path(case max_item_mask when 0 then null else volume end,' ')),
                         ' +',
                         '+'
                        ) || '). Total iteration count is ' || (iteration_cnt + 1) || '.' best_pick
  FROM  (
         SELECT  i item_number,
                 max_item_mask,
                 max_total_value,
                 max_total_volume,
                 value,
                 volume,
                 iteration_cnt
           FROM  knapsack
           MODEL
             DIMENSION BY(
                          item_number i
             MEASURES(
                      volume,
                      value,
                      count(*) over() cnt,
                      0 item_mask,
                      0 current_volume,
                      0 current_value,
                      0 total_volume,
                      0 total_value,
                      0 max_total_value,
                      0 max_total_volume,
                      0 max_item_mask,
                      1 item_set_mask,
                      0 iteration_cnt
             RULES ITERATE(1e9) UNTIL(item_set_mask[1] >= power(2,cnt[1]))
                item_mask[any]        = bitand(item_set_mask[1],power(2,cv(i) - 1)),
                current_volume[any]   = sign(item_mask[cv(i)]) * volume[cv(i)],
                current_value[any]    = sign(item_mask[cv(i)]) * value[cv(i)],
                total_volume[1]       = sum(current_volume)[any],
                total_value[1]        = sum(current_value)[any],
                max_item_mask[any]    = case
                                           when     total_volume[1] <= :capacity
                                                and
                                                    max_total_value[1] < total_value[1]
                                             then item_mask[cv()]
                                           else max_item_mask[cv()]
                                         end,
                max_total_volume[any] = case
                                          when     total_volume[1] <= :capacity
                                               and
                                                   max_total_value[1] < total_value[1]
                                           then total_volume[1]
                                         else
                                           max_total_volume[1]
                                       end,
                max_total_value[any] = case
                                         when total_volume[1] <= :capacity
                                           then greatest(max_total_value[1],total_value[1])
                                         else max_total_value[1]
                                       end,
                item_set_mask[1]     = case
                                         when total_volume[1] >= :capacity
                                           then item_set_mask[1] + min(case when item_mask > 0 then item_mask else null end)[any]
                                         else item_set_mask[1] + 1
                                       end,
                iteration_cnt[any]   = iteration_number
  WHERE CONNECT_BY_ISLEAF = 1
  START WITH item_number  = 1
  CONNECT BY item_number  = PRIOR item_number + 1
BEST_PICK
Will take items 3, 5, 6, 7. Total value will be 8 (3+3+1+1). Total volume will b
e 34 (19+6+6+3). Total iteration count is 59.
SQL> Keep in mind, solution is "optimized" to skip combinations when we already are at or over max capacity.
SY.

Similar Messages

  • Reg: Just for fun [Off-Topic] -

    Hi All,
    Has anybody ever seen Mr. Thomas Kyte over here?
    Or, Steven Feurstein behind the 'The PL/SQL Challenge'?
    Just getting curious to know because I've never seen those biggies over here.
    @Mod - Sorry for getting off-topic.
    - Ranit

    Re: DISTINCT not working with  wmsys.wm_concat

  • Request to have off-topic posts moved

    There are a number of posts accumulated in the Server and Storage Systems group of forums that are just not on-topic for them.
    Generally they've been posted by people that care to not read anything nor drill down to an appropriate forum and just dump a question.
    I've done the "report abuse" routine on a number of them but that seems to have been ignored.
    Thus this new post.
    These are from the last 60 days:
    (need to be moved to a Glassfish forum)
    How to start Galssfish when computer start
    Glassfish 3.0.1 updatetool
    http://forums.oracle.com/forums/thread.jspa?threadID=2128052
    war for modify domain.xml in glassfish 3
    Glassfish 2.1 + JPA 2: need some Sun/Oracle expert advice
    (topics for Sun Java System "whatever" applications, posted to server forums)
    AMPostAuthProcessInterface redirect problem
    http://forums.oracle.com/forums/thread.jspa?threadID=2127174
    Weblogic Spring/Sample Application Help
    Cannot add new LDAP Group Members in Sun Java Server 7.0
    http://forums.oracle.com/forums/thread.jspa?threadID=2134347
    Help with iPlanet
    iText vs Jasper Java Application Source Code
    OpenMQ Unack'ed messages causing Java Heap overflow in STOMP
    (database product questions posted to System Administration and hardware forums)
    how can i release lock record?
    Oracle for Mac
    Problem using TNS_ADMIN in registry (Ora. 11g R2 Instant client in Win. 7)
    http://forums.oracle.com/forums/thread.jspa?threadID=2154755
    /opt/SUNWwbsvr7/bin/wadm exited with error: 125
    Performance Testing tool
    ORA-00202 and Fractured block found during control file header read
    Performance Monitoring
    Reg : Weblogic Server Installation
    how can export from 11g to 9i
    What's wrong with oracle database11g? Is it a serious problem?
    Client download link needed
    http://forums.oracle.com/forums/thread.jspa?threadID=2149037
    Oracle 10G on VMware Redhat Linux
    http://forums.oracle.com/forums/thread.jspa?threadID=2138098
    I Can't Connect to Oracle
    what is the function of autoextensible field in dba_data_files?
    http://forums.oracle.com/forums/thread.jspa?threadID=2139323
    databse copy
    Advice needed regarding Database design practice
    enterprise manager
    http://forums.oracle.com/forums/thread.jspa?threadID=2128320
    Problem with granting privileges
    Inatalling IDM 11g on WondowsXp machine
    Any good resources for info on specifications for a new 11g install?
    During installation EMCA trows an error: Error uploading configuration data
    I received Validation error in the Backup Setting
    RMAN RESTORE
    Find the user(s) using more CPU in a database
    Oracle 10g 64-bit database on Windows 2008 R2 (64-bit) error ?
    http://forums.oracle.com/forums/thread.jspa?threadID=1554073
    Temporary tablespace not cleared
    TNS -12541 TNS: no listener
    Installing Oracle 11g on a server without network access
    RMAN Shows the following error... Please any one can help me....
    http://forums.oracle.com/forums/thread.jspa?threadID=2137784
    java.lang.Exception
    http://forums.oracle.com/forums/thread.jspa?threadID=2138186
    ORA-12543 When creating a new oracle instance, Oracle 11g
    Problem with Uninstalling Oracle 11.2 on Windows Server 2008
    problem installing mod_plsql oracle 11g linux
    Best practice for install oracle 11g r2 on Windows Server 2008 r2
    ORA-12535: TNS:operation timed out
    http://forums.oracle.com/forums/thread.jspa?threadID=1982259
    move datafile/tablespace in a partitioned table
    Orace 11g CRS installation ( windows server 2008 64 bit )  Error
    Datapump import from a map drive
    http://forums.oracle.com/forums/thread.jspa?threadID=1982528
    http://forums.oracle.com/forums/thread.jspa?threadID=2126409
    http://forums.oracle.com/forums/thread.jspa?threadID=2126802
    Oracle Startup/Shutdown with SQLPLUS and ORADIM in Windows...
    http://forums.oracle.com/forums/thread.jspa?threadID=1574872
    http://forums.oracle.com/forums/thread.jspa?threadID=2123572
    http://forums.oracle.com/forums/thread.jspa?threadID=2041227
    http://forums.oracle.com/forums/thread.jspa?threadID=2077085
    http://forums.oracle.com/forums/thread.jspa?threadID=2069660

    If these last few are pruned out of the SysAdmin forums, that should finish the housekeeping task. They're the most recent entries of off-topic questions.
    database postings to the SysAdmin forums
    Backup database with RMAN
    sql*NAT?
    How can convert Oracle 10g trial to License
    http://forums.oracle.com/forums/thread.jspa?threadID=2160796
    Visual Web Developer 2010 Express and Oracle ODAC - Oracle data provider
    http://forums.oracle.com/forums/thread.jspa?threadID=2160572
    Huge amount of "db file sequential reads" while INSERT APPEND operation
    http://forums.oracle.com/forums/thread.jspa?threadID=2160410
    Oracle Universal Installer - Toad - Virtual Machine Windows 7 on Mac
    What to check or can say from where to start?
    Where and how does oracle store tables?
    Oracle net configuration assitant failing while installing Oracle 11g.
    Resolving Mview Complete Refresh Performance
    Problem with silent install of 11gR1 on Windows 2008
    http://forums.oracle.com/forums/thread.jspa?threadID=2157067
    ORA-01991: invalid password file
    Sequences incorrect after exporting and importing a scheme
    http://forums.oracle.com/forums/thread.jspa?threadID=2153592
    http://forums.oracle.com/forums/thread.jspa?threadID=2149027
    http://forums.oracle.com/forums/thread.jspa?threadID=2128320
    http://forums.oracle.com/forums/thread.jspa?threadID=2137784
    http://forums.oracle.com/forums/thread.jspa?threadID=1982259
    http://forums.oracle.com/forums/thread.jspa?threadID=1574872
    http://forums.oracle.com/forums/thread.jspa?threadID=2123572
    http://forums.oracle.com/forums/thread.jspa?threadID=2041227
    http://forums.oracle.com/forums/thread.jspa?threadID=2077085
    http://forums.oracle.com/forums/thread.jspa?threadID=2069660
    http://forums.oracle.com/forums/thread.jspa?threadID=2113069
    http://forums.oracle.com/forums/thread.jspa?threadID=1981627
    http://forums.oracle.com/forums/thread.jspa?threadID=1981082
    http://forums.oracle.com/forums/thread.jspa?threadID=1981287
    http://forums.oracle.com/forums/thread.jspa?threadID=1979404
    http://forums.oracle.com/forums/thread.jspa?threadID=1955376
    http://forums.oracle.com/forums/thread.jspa?threadID=1844213
    http://forums.oracle.com/forums/thread.jspa?threadID=1773975
    http://forums.oracle.com/forums/thread.jspa?threadID=1773059
    http://forums.oracle.com/forums/thread.jspa?threadID=1555844
    http://forums.oracle.com/forums/thread.jspa?threadID=1555363
    http://forums.oracle.com/forums/thread.jspa?threadID=1554035
    http://forums.oracle.com/forums/thread.jspa?threadID=1518192
    http://forums.oracle.com/forums/thread.jspa?threadID=1272113
    http://forums.oracle.com/forums/thread.jspa?threadID=1134136
    http://forums.oracle.com/forums/thread.jspa?threadID=1938192
    Again, the community moderators don't have permissions to do that.
    Thanks

  • Suggestion​: General Discussion​s\Off Topic Section

    hi,
    it would be great to have an off topic forum/section here for us to interact and have general discussions. almost every forum i'm a member of has an Off Topic section. we can get to know each other much better and share useful information and opinions about various topics, technology and others also. we can do the same through PM's, but getting everyone involved will feel much better.
    Make it easier for other people to find solutions, by marking my answer with \'Accept as Solution\' if it solves your problem.
    Click on the BLUE KUDOS button on the left to say "Thanks"
    I am an ex-HP Employee.

    if they start posting technical questions or spam here, then they should be banned!
    EDIT: in other news, my reputation level increased!
    Message Edited by DexterM on 01-07-2009 11:44 PM
    Make it easier for other people to find solutions, by marking my answer with \'Accept as Solution\' if it solves your problem.
    Click on the BLUE KUDOS button on the left to say "Thanks"
    I am an ex-HP Employee.

  • Slightly off topic: Read-only tables pre 11g

    Hi gang
    I'm just writing up a database quiz for a local user group and I was hoping I could get a bit of inspiration from the database experts.
    One of the questions will be "prior to 11g with the introduction of read-only tables, how could you make a table read-only?". The answers I've come up with:
    1) Security priviliges (schema + grant SELECT)
    2) Triggers
    3) Create a check constraint with disable validate
    4) Read-only tablespace
    5) Read-only database (standby)
    6) (Slightly crazy) Create view, and instead-of triggers that do nothing (similar to 2)
    7) Write the query results on a piece of paper and then turn the database off
    Anybody have any other answers, real or slightly off topic like mine please? ;)
    Cheers,
    CM.

    Check constraint and trigger solutions may have problems with sqlldr direct path operations, so using it together with alter table disable lock may be mandatory depending on the needs. Especially if DDLs are also wanted to be avoided.
    This topic was once mentioned on Tom Kyte's blog or asktom but I couldn't find the source to link here.
    SQL> conn hr/hr
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as hr
    -- cleaning objects
    SQL> drop table tong purge ;
    Table dropped
    SQL> drop view vw_tong ;
    View dropped
    -- creating the demo table
    SQL> create table tong ( col1 number ) ;
    Table created
    SQL> alter table tong add constraint cc_tong check ( 1=0 ) disable validate;
    Table altered
    SQL> alter table tong disable table lock;
    Table altered
    -- some DDL tests
    SQL> drop table tong ;
    drop table tong
    ORA-00069: cannot acquire lock -- table locks disabled for TONG
    SQL> truncate table tong ;
    truncate table tong
    ORA-25128: No insert/update/delete on table with constraint (HR.CC_TONG) disabled and validated
    SQL> alter table tong parallel ;
    alter table tong parallel
    ORA-00069: cannot acquire lock -- table locks disabled for TONG
    SQL> lock table tong in exclusive mode ;
    lock table tong in exclusive mode
    ORA-00069: cannot acquire lock -- table locks disabled for TONG
    -- some DML tests
    SQL> select * from tong ;
          COL1
    SQL> update tong set col1 = col1 + 1 ;
    update tong set col1 = col1 + 1
    ORA-25128: No insert/update/delete on table with constraint (HR.CC_TONG) disabled and validated
    -- creating dependent objects test
    SQL> create index nui_tong on tong(col1) nologging ;
    Index created
    SQL> create view vw_tong as select * from tong ;
    View created
    added comments to the code
    Message was edited by:
    TongucY

  • MQ, eSQL and CLOBs (Off Topic)

    Hi,
    Apologies for this way off topic post, but I figured someone here may know the answer to this one and save me some time digging / testing.
    We're designing a middleware hub using WBIMB (MQ) v5 and have the option of
    a. Sending a message to a JMS Listener that will write an entry in a database via JDBC
    b. Having the broker flow insert the record using a compute node / java node.
    If we choose option b my preference would be to use eSQL, but the database table has a CLOB column and I'm not sure whether this is supported.
    Any ideas?
    Thanks for your help,
    Steve

    Hello Huffer Many thanks for your prompt reply. I have been doing a bit more research and came across an old spec for a "lenovo" hard-disk (HDD) with 320GB capacity used in numerous ThinkPads. Unfortunately it does not include the X300 model that i have. The full details can be found HERE. The height of the HDD is 7 (SEVEN) mm. I may be paranoid but can you please just confirm that the lenovo X300 ThinkPads (see full details above) with the 320GB HDD really have a height of 9.5mm and so will be able to take the HDD 2.5" with 2TB that I plan to buy. If the height really is only 7m then I have a problem.  Then I think that i will have to go up my idea of increasing the storage space. If you cannot answer the question with 100% certitude then I will have to reopen the laptop and measure the space available but that is a pain since I am new to all this and afraid of damaging the HDD. Thanks. Cheers. Steve.  

  • (off topic) BEWARE OF CNET DOWNLOADS!!!!

    I know that this is slighly off-topic for this forum, but I wanted to spread the word about CNET downloads (download.com).  Several months ago, CNET was slapped on the wrist for intentionally adding spyware into the programs on their download website. 
    Well, they stopped for a while and they're at it again.  I wrote to them saying that I had trusted CNET for years because of their policy against spyware and mailicious code.  A few weeks ago, I needed to download a program to check wifi channels on my wireless network, and ended up having to perform a full virus/spyware scan aftrer downloading TWO different programs from CNET's download site.  After installing each program, I ended up having my homepage hijacked and dozens of popups appearing offering to fix my computer!
    I thought that maybe it was just the first program (slipped by heir radar), but the SECOND one had the same problem.  I then went to the publisher's website and found his blog complaining that his program was free of malicious code and that it was inserted by CNET/Download.com AFTER he had uploaded it to the web.
    His recommendation is that, if you can't go directly to the publisher's site for a download, File-Hippo is still a fairly clean site.
    Please pass this info on to friends and colleagues.
    SD
    All people have photographic memories - some are just missing the film!

    Sophiesdad, welcome to the forum.
    I know that you are correct.  I have found this to be very true.  The only way that I have found to get around this situation is use the "Custom" option to do the install.  This allows me to decline all of the garbage that they want to add to my computer.  It has worked so far.
    This is not the only website that does this, however.  I have found it to be true on Softpedia, also.  It was my most trusted until lately.
    Signature:
    HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
    HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
    HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
    HP Photosmart 7520 AIO
    ++++++++++++++++++
    **Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
    Intelligence is God given; Wisdom is the sum of our mistakes!
    I am not an HP employee.

  • WebAssist Cart help? I know it's off topic but... Could really use some help...

    I've got a shopping cart that is working and I'm trying to update the
    quantities in inventory by subtracting the quantity ordered from the total
    inventory in a table called ITEMS.
    I can update a record after a sale in the cart, but right now it is
    updating by completely replacing the value of the items in inventory with
    the quantity in the checkout cart. So, if there are 800 items, after the
    update, there are -1 total in inventory, not 799.
    The problem is that I don't know how to coordinate the item(s) in the stored
    shopping cart with a call to their ID and quantity in the online database.
    Here's what I have so far:

    Ahhhhhhhh Jeff...<br />If I can get this going...<br /><br />I spent days looking for this solution.<br />Thank you very much.<br />Just bought Dreamweaver CS3 and am battling through the bells and whistles.<br /><br />Liz<br /><br />----- Original Message ----- <br />From: "jefferis" <[email protected]><br />To: <[email protected]><br />Sent: Tuesday, June 19, 2007 9:50 AM<br />Subject: Re: WebAssist Cart help? I know it's off topic but... Could really <br />use some help...<br /><br />>A new message was posted by jefferis in<br />><br />> ADDT - PHP Application Development --<br />>  WebAssist Cart help? I know it's off topic but... Could really use some <br />> help...<br />><br />> On 6/16/07 3:06 PM, in article [email protected],<br />> "[email protected]" <[email protected]> wrote:<br />><br />>> Hi jefferis....<br />>><br />>> How did you solve the problem?<br />>> I am having the same problem trying to incorporate an inventory code into <br />>> a<br />>> shopping cart that will deduct the number of items purchased from my <br />>> total<br />>> inventory to let me and my customers know how many items I have remaining <br />>> in<br />>> stock.<br />>><br />>> Ex:<br />>> inventory: 500 plants<br />>> purchased: 20 plants<br />>> remaining inventory: 480 plants<br />><br />> Yes I did.<br />><br />> I've been struggling with this piece of pie for about 5 days and<br />> thought it might benefit others, so here's a way to update your quantities<br />> in INVENTORY after a checkout success.  I read another thread but found it<br />> way too complex and depended on holding inventory in the session:<br />> http://www.webassist.com/professional/support/kbcompletethread.asp?DiscID=33<br />> 046<br />> But you may lose the info when you go offsite to Paypal, e.g., to complete<br />> the transaction.<br />><br />> Here's my approach using the "checkout_success.php" page.  Using this page<br />> works because user arrives here ONLY after a successful purchase.<br />> First of all, I used the BSM php sample store as a starting point.  I <br />> added<br />> an ItemQuantity field to the items DB to track the stock or items in<br />> inventory in the store.<br />><br />> In order for this automatic deduction of sold items to work, it must be<br />> placed within the do while {  area of the  display page for the cart's<br />> items. } The code is commented below:<br />><br />> <?php<br />> //WA eCart Show If Start<br />> if (!$eCart->IsEmpty())     {    // IF CART NOT EMPTY...<br />> ?><br />>    <h2>Order Receipt </h2>  // STANDARD STUFF TILL NEXT COMMENT<br />>    <br /><br />>    <h3 class="eCart_OrderHeaderInfo">Order number: <?php echo <br />> session_id();<br />> ?></h3><br />><br />>    <p class="eCart_OrderHeaderInfo">This is your order receipt. Please <br />> make<br />> a copy for your records. An email will also be sent to you. </p><br />>    <table class="eC_ShoppingCart" border="0" cellspacing="0"<br />> cellpadding="0"><br />>            <tr><br />><br />>                    <th>Name</th><br />><br />><br />>                    <th>Price</th><br />><br />><br />>                    <th  class="eC_FormItem" >Quantity</th><br />><br />><br />>                    <th>Total</th><br />>            </tr><br />>        <?php<br />> while (!$eCart->EOF())      {  // DO WHILE FOR EACH ITEM IN CART<br />> ?><br />>            <tr><br />><br />>                    <td><img src="/images/thumbs/<?php echo<br />> $eCart->DisplayInfo("Thumbnail"); ?>" alt="" width="100" height="100"<br />> class="eC_ProductThumb" /><br />>                        <p class="eC_ItemLabel"><?php echo<br />> $eCart->DisplayInfo("Name"); ?></p><br />>                  <p class="eC_ItemDescription"><?php echo<br />> $eCart->DisplayInfo("Description"); ?></p>  <p<br />> class="eC_ItemDescription"><?php echo $eCart->DisplayInfo("ID");<br />> $idCall = $eCart->DisplayInfo("ID");?>>  // CREATE A VARIABLE FOR<br />> //THE ITEM's ID NUMBER in the DB<br />> //USE DISPLAY ID TO GET ID # and make it = $idCall<br />> </p></td<br />>                    <td  class="eC_PriceItem" ><?php echo<br />> WA_eCart_DisplayMoney($eCart, $eCart->DisplayInfo("Price")); ?></td><br />><br />><br />>                    <td  class="eC_FormItem" ><?php echo<br />> $eCart->DisplayInfo("Quantity");<br />> $solditems = $eCart->DisplayInfo("Quantity");?>  //DO THE SAME FOR <br />> QUANTITY<br />> //SOLD, MAKE QUANTITY SOLD  = $solditems<br />> </td><br />><br />> // NOW UPDATE THE DATABASE. SUBTRACT $solditems from ItemQuantity ( YOUR<br />> //INVENTORY OR STOCK)<br />> //FOR EACH ITEM IN CART. SELECT the item's ID  by $idCall:<br />> <?php<br />> mysql_select_db($database_connBSM, $connBSM);<br />> $query_itemQ = "Update items SET  items.ItemQuantity = <br />> items.ItemQuantity -<br />> $solditems WHERE items.ItemID = $idCall";<br />> $itemQ = mysql_query($query_itemQ, $connBSM) or die(mysql_error());<br />><br />> ?><br />>                    <td  class="eC_PriceItem" ><?php echo<br />> WA_eCart_DisplayMoney($eCart, $eCart->DisplayInfo("TotalPrice")); ?> </td><br />>            </tr><br />>        <?php<br />>  $eCart->MoveNext();    //// REPEATS BEHAVIOR FOR EACH ITEM IN CART<br />> }<br />> $eCart->MoveFirst();<br />> ?><br />> BTW, once the items in inventory = 0, the items do not appear in the<br />> catalog.  That is set in the catalog page's recordset.<br />> Jeff<br />> ~~~~~~~~~~~~<br />> Jefferis Peterson, Pres.<br />> Web Design and Marketing<br />> http://www.PetersonSales.com<br />><br />><br />><br />><br />> ------------------------------------------------------<br />> View/reply at <<a href="/cgi-bin/webx?13@@.3bc3e9d6/5">jefferis, "WebAssist Cart help? I know it's off topic but... Could really use some help..." #6, 19 Jun 2007 6:50 am</a>><br />> You must visit the conference to reply. Email replies are not allowed and <br />> will be returned.<br />> Use the unsubscribe form at <br />> <a href=http://www.adobeforums.com/cgi-bin/webx?280@@.3bc3e9d6!folder=.3bc3909c> <br />> to cancel your email subscription.

  • VirtualBox - somewhat off-topic

    I know this is somewhat off-topic, but I'm hoping there's some expertise here that will be a bit more helpful than when I asked this on the VirtualBox forums.
    For a coupe of years now I've been running my own private test lab on my laptop, using VMworkstation. It's been working to my satisfaction, but with all the recommendations to use VirtualBox (after all, it's free) I thought I'd give it a try. This was a few months back, and I ran into a real problem with the way VB appears to handle networking vs. VMware.
    With VMware, I set all my virtual machines to use NAT. This allows me to give the vm a fixed IP address, not reveal itself outside the host OS, and still reach the internet for things like yum updates. Obviousely, bridged network would allow me to access the inernet, but would make me have to play by the rules of whatever network I'm on -- my company or my home ISP. Host only would address that but not allow me to pull updates from the internet.
    Now, with VirtualBox, I couldn't get NAT to work with a fixed IP address that I assigned to the vm. The guys at the VB forum couldn't seem to understand why that was an issue. They just kept saying to allow the vm to use a DHCP assigned address and 'everything just works'.
    I don't have VB installed at the moment, so can't re-run tests, but thought I'd throw this out to see if it rings a bell with anyone, and if so if there might be a solution. I still tend to believe VB will do a fixed guest IP with NAT and I just wasn't seeing how to make it work, but perhaps not.
    Comments?

    Dude wrote:
    In NAT mode, the guest network interface is assigned to the IPv4 range 10.0.x.0/24 by default where x corresponds to the instance of the NAT interface +2. So x is 2 when there is only one NAT instance active. In that case the guest is assigned to the address 10.0.2.15, the gateway is set to 10.0.2.2 and the name server can be found at 10.0.2.3.
    If, for any reason, the NAT network needs to be changed, this can be achieved with the following command:
    VBoxManage modifyvm "VM name" --natnet1 "192.168/16"
    This command would reserve the network addresses from 192.168.0.0 to 192.168.254.254 for the first NAT network instance of "VM name". The guest IP would be assigned to 192.168.0.15 and the default gateway could be found at 192.168.0.2.
    I suggest to review the documentation for more details
    http://www.virtualbox.org/manual/ch06.html
    Sorry for the delayed response. I've just now re-installed VBox and created a 64-bit Oracle Linux 5.7 machine.
    After reading yet again the networking chapter in the VBox user manual, I'm afraid I'm just as confused as ever. Perhaps if I detail exactly how I'm used to setting things up with VMware and the resulting behavior, we can see the corollary for VBox.
    When I install VMware, it creates two network adapters on the host OS, vmnet1 and vmnet8. vmnet8 is used for NAT. I've installed on several machines and vmnet8 is always assigned an address of 192.168.something.1. The 'something' seems to vary from install to install. I'm not sure what controls the assigned value there, but have never really needed to explore that. My current setup is at 192.168.111.1.
    Next, I create a virtual machine. There I configure eth0 to use a fixed IP address of 192.168.xxx.yyy, where 'xxx' matches the value of the vmnet8 adapter on the host os, and 'yyy' is assigned sequentially, starting with 101 for the first machine I create, 102 for the next, etc. When creating these machines, I've found I have to set the gateway and DNS address to 192.168.xxx.2.
    With that setup,
    - my guest vm can ping the host
    - the host can ping the guest vm
    - I can create an entry in the host os's 'hosts' file pointing to the guest vm (ie: 192.168.111.101 vmlnxsrv01.vmdomain vmlnsxrv01), then use that name to refer to the vm
    - I can use an ssh client like putty (on the host os) to connect to the vm, exactly like I would connect to a remote box on my company's network
    - The vm can reach the internet to do web browsing, download rpms, etc.
    Now, when i installedVbox, it created one additional network adapter on the host os. It is running at 192.168.56.1
    I created the virtual machine, giving it a fixed IP address of 192.168.56.111, gateway and dns address of 192.168.56.2
    Ping of the vm ip address from the host returns 'host unreachable' doesn't work either direction
    C:\Users\ed>ping 192.168.56.111
    Pinging 192.168.56.111 with 32 bytes of data:
    Reply from 192.168.56.1: Destination host unreachable.
    Ping statistics for 192.168.56.111:
        Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
    Control-C
    ^CSame from the other end, pinging 192.168.56.1 and 192.168.56.2 from the vm
    Tried the vboxmanage, but not sure if I gave it the correct parameters.
    C:\Program Files\Oracle\VirtualBox>vboxmanage modifyvm "lnxsrv11" --natpf1 "gue
    tssh,tcp,,2222,192.168.56.111,22"
    C:\Program Files\Oracle\VirtualBox>ping 192.168.56.111
    Pinging 192.168.56.111 with 32 bytes of data:
    Reply from 192.168.56.1: Destination host unreachable.Also at this point, an attempt to establish a putty session to 192.168.56.111 times out.

  • [YAY MODERATORS!]: Off Topic Invas

    <center>We all have our reasons for being here, whether to seek advise, solve a problem, or help others with their questions. An often overlooked aspect of these forums is vital though, and that is the forum's moderators. To put it simply, there would be no forums without their hard and persitant work, positi've attitude, and determination.</center>
    Dale, John, Jason, and Cat spend hours every day doing things that may or may not even be noticed by forum members. Looking up some solutions to your problems can take hours, with emails and phone calls involved. Not only to they help with problems, but with keeping the boards organized and legal. Their work is necessary in providing this great community!
    I, on behalf of the forum, would like to say a BIG thank you for everything you do!
    Fellow forum members, go ahead and say thank you too! Feel free to post below, or change you signature (see below) to show your thanks.
    ------------- Signatures:
    Sigs go under every one of your posts, and you can edit your sig under "My Profile". They need to be in HTML for it to work. Below is the code. Please know that all brackets( [ , ]'s ) need to be replaced with arrows (shift and comma, shift and period). Show your thanks, use this sig!
    [img src="http://img487.imageshack.us/img487/507/yaymodsjf7.gif"]
    Thank you, penguinking3, for making the above signature for the forum!
    And Jeremy, you also deserve a round of applause. Thanks for organizing this whole thing! You always have everyone's best intentions in mind.Message Edited by Trance on 09-0-2006 09:0 PM

    Trance wrote:
    Dale, John, Jason, and Cat spend hours every day doing things that may or may not even be noticed by forum members. Looking up some solutions to your problems can take hours, with emails and phone calls involved. Not only to they help with problems, but with keeping the boards organized and legal.
    don't forget all there hard work smiting those forum trolls
    Thanks all you mods, especially Cat for putting up with all of our crazy requests about the color of our names
    And feel free to stop by off topic, were nice

  • Off Topic - Cameras - 30D, 5D or D200?

    Hi there, I'm a non-pro frequenter of the Apple discussion boards, I know this is off topic but I'd sure appreciate some quick advice, I need a camera ASAP for a work project and I don't have time to do the research that I should I'm hoping somebody here can give me a concise answer. My choices so far are narrowed down to the Canon 30D, the Nikon D200, and possibley the Canon 5D can any one recommend which would be the better camera for image quality when used by a non-pro (although I do have some technical experience and don't have a problem using a camera in manual mode). Main point is the image quality at the end of the day, and also the better investment as a camera. Mostly I don't want to get an over priced dudd... I've heard the 5D is good but over priced - anyway.... any help anyone? I'd really appreciate it.
    Many Thanks,
    Miklos.

    My choices so far are
    narrowed down to the Canon 30D, the Nikon D200, and
    possibley the Canon 5D can any one recommend which
    would be the better camera for image quality
    All those cameras and many less expensive others when used with top quality Nikon/Canon lenses are capable of providing excellent image quality when used with a (very essential) pro quality tripod and head plus remote shutter release (add $500-1000 for those if you intend to build a rig at the pro end of things). The 5D is slightly more capable of the best low light images in the group, but at a cost of more than twice as much. The lenses you choose will be much more relevant than the individual cameras - and should accordingly represent more than half of your expenditure.
    The choice between Nikon and Canon should be made by handling the cameras in your short list. Hopefully ignoring the BS that salesman insists on telling you.
    Main point is the image quality at the
    end of the day, and also the better investment as a
    camera. Mostly I don't want to get an over priced
    dudd... I've heard the 5D is good but over priced -
    anyway...
    DSLRs are not investments per se as cameras any more than computers are. DSLR values will decrease over time, but they invest extremely well in your productivity as a photographer.
    IMO since you are relatively inexperienced in this dynamic world of DSLR you should start at the $1500 range for camera body only and add high quality lenses. If you choose Nikon, for indoors architecture I recommend the excellent 10.5mm fisheye that using software can provide rectilinear images, the excellent 12-24mm, and a f/1.4 50mm. At the tele end I like the 70-200mm VR, but an 18-200mm would probably suit for photojournalism type shots.
    If you choose Canon there are equally excellent lenses available. I recommend against third party lenses because they typically will not support all the features of modern Nikon/Canon DSLR systems in the future even if they do so today.
    Note that although architectural is often shot with DSLR (including by me), highest quality architectural images are not created with DSLR cameras. They are shot with medium format film view cameras that allow extensive tilts and swings within the camera body. The use of such cameras makes a huge difference.
    -Allen Wicks

  • Off topic, HEY MODERATOR!

    I experimented with the preview version of MSFT's IE 10 and can't get it to work on this site?  I'm unable to reply to posts, clicking on the "Reply" button does nothing even though the mouse pointer turns into a hand as it should.  Same with trying to "Like" a post, nothing happens.
    Can something be done about this?  IE 10 is the standard brower in Windows 8 and will probably be included in updates for Windows 7 very soon so it needs fixing pretty soon.
    FWIW, I don't have any problems with IE 10 in any other forums I've visited, only this one.
    Sorry to be so far off topic but I can't find a "Contact Webmaster" button.

    Thanks, that's good to know.  If the moderator can pass the info on to whoever is webmaster it should get fixed (I hope?)  I switched to Windows 8, read these replies and had to reboot back to Windows 7 to reply!
    I suspect it's a matter of changing some coding, let's hope it's not a very complex problem?

  • Off-Topic Speculation?

    hello everyone, I'm really new to these boards so please don't be too harsh on a newbie lol. I just received an email stating my post had been deleted from the "does anybody know when the i5/i7 imacs will actually ship?" thread. All I did was ask whether anybody thought the delay in setting a specific date might be due to overheating issues and my post was removed as being "off-topic" and "speculative"....isn't the premise of that entire board speculative? I see all kind of comments on there speculating reasons for the lack of a set date but yet I merely ask if it might be due to heat issues and BAM...its gone. I wasn't claiming it was because of overheating I was only asking if maybe it was possible....because I ordered an i5. It said my post was removed by host....does that mean the person who started the thread deleted my post or an Apple employee? I certainly hope its not the latter because like I said, that whole thread is based on speculation so for my post to be removed so quickly by an Apple employee makes me wonder if maybe there is a problem if so I think those of us who have put 2000 or more toward these computers deserve to know...or at the very least, not be censored for asking. Like I said I don't know if thats even the case with post deletion...I'm fairly new here.

    KJH1986 wrote:
    Again thanks everyone and Apple...I love ya but I feel like even though these forums are for your customers you are forcing some of us to discuss the products we bought from you elsewhere on the web if we want to do so freely. I'm sure that is not the intention of these boards : )
    Actually, I think it is Apple's overt intention to limit these forums to user-to-user discussion of technical issues with Apple products, just as the Terms of Use explain. The ToU expressly forbid discussion of unreleased products or of Apple policies here, so if you want to do that, you should do so elsewhere on the web.
    The ToU exist not so much to protect Apple's reputation or its well-known penchant for secrecy about unreleased products as they do to insure that these forums are useful & productive for those who use them. Because we are just users, & because Apple employees are expressly forbidden from posting anything here that could be considered as officially from any Apple source other than Discussions moderators or hosts, any reply to comments about these things would of necessity be conjecture -- IOW, just wild guesses. But because these forums are hosted by Apple, some users will assume otherwise, as if we are somehow Apple insiders, or that comments to Apple (like your mention of "your customers") are actually somehow reaching those officially empowered to speak for Apple about such things.

  • Forum Atom feed and the Off-Topic forum

    I'm subscribed via https://bbs.archlinux.org/extern.php?ac … der=posted and I've just noticed I don't get any notification if a new thread gets opened in Off-Topic forum. I haven't yet checked if any other forum is also excluded.
    I know that I can subscribe to this forum via 'Subscribe to this forum' but according to http://projects.archlinux.org/vhosts/bb … extern.php the default feed shouldn't miss any subforums, as there are no nfids mentioned.
    What am I missing?

    ngoonee wrote:
    Inxsible wrote:I don't mind opening the off-topic section as read only to not logged-in users/non-members
    As I recall off-topic, dustbin, and TGN are log-in so that moderation there can be slightly more lenient, since its guaranteed its only our community in the place (no lurkers)? Not part of the 'main' forums in that sense, then.
    EDIT: lurkers and/or bots, which is the main point.
    This is correct. We don't want someone to type "Arch Linux" in a search engine and to get, as the first link, an off-topic forum thread about some random absurdities or some TGN rant.  The same goes with someone visiting the forum to see what kind of community Arch Linux has before installing it. It's a question of giving a good first impression while still being able to have a good time.

  • Somewhat off topic, wedding lighting and wireless lav. question

    Hello everyone! This question is slightly off topic, but I'm desperate for an answer. I've been doing wedding videos for some time now and it's time to upgrade my setup. I'm currently in the market for a good, reliable wireless lavaliere mic, and a good quality on camera light. I use a panasonic DVX100b for all of my footage. For the light I'd like to spend about $400.00 ish or less, but I will spend more if the price jump dramatically increases the performance. I also have about $600 to spend on a wireless lav. system, again I will pay more if the jump in price brings a considerable jump in quality. Can anyone make any recommendations?
    Thanks

    Gotta go with the Sennheiser Evolution series as well. Although I can't say that the actual mics they ships with are the best, they're not bad and I've had very few issues with the range and reception.
    And if you're shooting solo, aside from the mics, make sure you pick up a 2 or 3 foot XLR cable so that you have enough hose to allow you to hook the receiver on to your belt. Beats clipping it to the handle strap.
    You can also get a little adapter for the DVX that will allow you to mount the mics on the camera hot shoe on the top of the handle. I'm sure you can get these for just about and wireless you buy.
    rh

Maybe you are looking for

  • I downloaded a book on iTunes with my MacBook Pro and can't figure out how to open on my computer.  How do I do this?

    I downloaded a book on iTunes with my MacBook Pro and want to read the book on my computer.  Just can't figure out how to do it.  Do I need a program to read books on the MacBook first or is this something I can get in the app store? Any help is much

  • Gdm 1080p small font

    Hi fellas, I got arch installed on my media pc hooked up to a 1080p lcd TV (using dvi to hdmi cabling).  The problem i have is that in gdm, the fonts are inscrutably small and unlegible.  They are just tiny...  I'm using 1920x1080 and the text look l

  • How to stop modal blocking in adf dialogs?

    How to stop modal blocking in adf dialogs? blocking="false" has no effect. <af:commandLink id="showRequestDetail" action="dialog:guide.sa_requestDetail" partialSubmit="true" actionListener="#{shareAccessRequestDetail.load}" useWindow="true" blocking=

  • BI IView Portal Exception Error SP13

    Hi,  Right now we are unable to execute any of our current BI IViews in the Development BI Portal and I’m thinking its SPS 13 related.  (Of course this problem perfectly coincided with some Portal rework I was doing, so originally I thought it was so

  • Matchcode for parameter

    Hello, i have a parameter  p_fname  type filenameci-FILEINTERN .How can i associate a matchcode so that on F4,i get a popup showing all the fileintern?