Home Super Mario Bros Games Puzzle Games Physics Games Flash Games Girls Games Marvin Games Games Walkthroughs
Java Program Tutorials

Only Best Physics Games

Hey guys I'm trying to see where my pairs of keys stop, I have arrays built like this

EDIT People are getting really confused so I'm using a real array instead of an example

array (
  'key' => '',
  'po' => '',
  'label' => '',
  'report_key' => '',
  'shipper' => '',
  'status' => '',
  'location' => '',
  'inspector' => '',
  'commodity' => '',
  'brand' => '',
  'case_count' => '',
  'variety' => '',
  'style' => '',
  'grower_lot' => '',
  'pack_date' => '',

  // grouping 4 items
  'berry_size1' => '',
  'berry_size2' => '',
  'berry_size3' => '',
  'berry_size4' => '',

  // grouping 3 items
  'bunch_color1' => '',
  'bunch_color2' => '',
  'bunch_color3' => '',

  // grouping 2 items     
  'color1' => '',
  'color2' => '',


  // grouping 3 items
  'stem1' => '',
  'stem2' => '',
  'stem3' => '',


  // grouping 2 items
  'shatter1' => '',
  'shatter2' => '',


  // grouping 2 items
  'splits1' => '',
  'splits2' => '',


  // grouping 2 items
  'wet_sticky1' => '',
  'wet_sticky2' => '',

  'overall_quality' => '',


  // grouping 2 items
  'sugar_brix1' => '',
  'sugar_brix2' => '',

  'rating' => '',
  'comments' => '',
)

I came up with some stupid way that really doesn't work to try and sort things out, its extremely backwards, honestly I'm pretty embarrassed by my attempt.

            foreach($obj as $key=>$val) {

            if(strpos(  preg_replace('/[^a-z]/i', '', $key), 
                        preg_replace('/[^a-z]/i', '', $all_keys[$key+$b+1])
                        ) !== false) { echo "<p>$key</p>"; // items 1-3 will show
            } elseif(strpos(preg_replace('/[^a-z]/i', '', $key), 
                            preg_replace('/[^a-z]/i', '', $all_keys[$key+$b-1])
                            ) !== false) { echo "<p>$key</p>"; // show last item
            } else {

                  $in.='<aside class="left">';
                    $in .= "<label for='$key'>". ucwords(strtolower(str_replace('_',' ',$key))) ."</label><br/>";
                    $in .= ($key=='key') ? "<input type='text' value='". $objLastId ."' id='$key' class='disabled' disabled='disabled'>" : "<input type='text' value='' name='$key' id='$key'>";
                  $in.='</aside>';

              $b++;
              }
            }

Anyway what I'm really trying to achieve is something like this, could someone steer me in the right direction please?

<style>
 .row2 input {width: 50px !important;}
 .row3 input {width: 27px !important;}
 .row4 input {width: 15px !important;}
</style>

// stem was a 2 item group, so should have the row4 class
// and should have the second item appended by a &nbsp; 
// all be inside the same grouping, like below ...
<aside class="left row2">
<label for="color1">Color</label>
<br/><input type="text" value="" name="color1" id="color1">
&nbsp;<input type="text" value="" name="color2" id="color2">
</aside>


// stem was a 3 item group, so should have the row4 class
// and should have items 2-3 appended by a &nbsp; all be inside 
// the same grouping, like below ...
<aside class="left row3">
<label for="stem1">Stem</label>
<br><input type="text" id="stem1" name="stem1" value="">
&nbsp;<input type="text" id="stem2" name="stem2" value="">
&nbsp;<input type="text" id="stem3" name="stem3" value="">
</aside>


// berry_size was a 4 item group, so should have the row4 class
// and should have items 2-4 appended by a &nbsp; all be inside 
// the same grouping, like below ...
<aside class="left row4">
<label for="berry_size1">Berry Size</label>
<br/><input type="text" id="berry_size1" name="berry_size1" value="">
&nbsp;<input type="text" id="berry_size2" name="berry_size2" value="">
&nbsp;<input type="text" id="berry_size3" name="berry_size3" value="">
&nbsp;<input type="text" id="berry_size4" name="berry_size4" value="">
</aside>

... or ...

// this is a single, so no extra class and ....
<aside class="left">
<label for="other_item">Other Item</label>
<br/><input type="text" id="other_item" name="other_item" value="">
</aside>

What I see this really boiling down to is reading the next array keys name (I stripped the name and used the integer in my version), atleast I think that's the right way to do it?


View the Original Page Here: PHP is the next key a part of the current?     Back to the List

Cheats, Walkthroughs Related to: PHP is the next key a part of the current?

Only Best Physics Games

Please let me know how to achievethis layout of grid;

pls see image here: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/742d9996-b663-4e00-84dc-bdec25f72831

Thanks Dee

Update Date: 2012-05-20 17:08
Searched Times: 0

On textboxes in Android, onLongClick reveals a contextual menu that has the copy/paste methods. Is there any way to add another option (say, "copy to [insert application here]")?

It's trivial to do it within my application's contextual menu because I can just override onLongClick. My "copy to [insert application here]" method, however, would only work in my app's contextual menu; not in the default messaging's text selection contextual menu, for example.

Thanks!

Update Date: 2012-05-20 17:08
Searched Times: 0

I'm trying to create an abstraction where I can listen to change events of a redis collection and have the key, value passed into a callback. I was wondering if it would be possible to do this with Lua scripting on the newer versions.

Thanks!

Update Date: 2012-05-20 17:07
Searched Times: 0

I'm trying to get Facebook to publish a read action using php but I've coded it wrong totally and need a little help:

<?php    
function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return $pageURL;
}
?>

<?php

curl -F 'access_token=MY ACCESS TOKEN' \
     -F 'article=echo 'echo curPageURL();' \
        'https://graph.facebook.com/me/news.reads'

?>

The second part is that bit I can't translate into PHP properly. I've no idea where to start as I'm a novice with php and only just learning the Opengraph API.

Update Date: 2012-05-20 17:07
Searched Times: 0

I have a custom XML file that configures a monitor in a webpage.

<monitor name="My Monitor" refresh="600" style="SideBySide">
  <description>Example of two monitors displayed side by side</description>
  <widget name="MyFirstWidget" style="TableStyle1"/>
  <widget name="MySecondWidget" style="TableStyle2"/>
</monitor>

In my Monitor.aspx page, the above xml file is parsed (according to the name of the monitor passed in the query string) and the final Page is rendered.

The SideBySide stylesheet will apply to the entire page because it is part of the monitor. In my code I inject it into the page <head>.

For each widget (which are UserControls), I also inject the style into the <head>, however, at the moment both MyFirstWidget and MySecondWidget styles will affect each other because they are both global in scopr. This is not what I want, I need the styles to be totally independent.

Can anyone think of a way to do this is a generic way. ie, the styles will be used for many different widgets therefore I can't had code anything in the stylesheet that would apply only to a particular widget.

Update Date: 2012-05-20 17:06
Searched Times: 0


Only Best Physics Games


Java Program Examples
RSS4Java.com is dedicated to popular Java technology posts, blogs and entries.
Copyright© 2010 Rss4Java.com. Java is a trademark of Sun Microsystems, Inc. All blogs, posts and entries are the property of their authors.