<?phpxml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<channel>
<title>globberstack.com / topdog / Upcoming Questions</title>
<link>http://www.globberstack.com</link>
<description>Linux, Apache, MySQL & PHP Community Questions & Answers </description>
<pubDate>Sun, 05 Feb 2012 09:42:40 -0500</pubDate>
<language>en</language>
<item>
<title><![CDATA[Upgrading the existing database in a PHP system]]></title>
<link>http://www.globberstack.com/Questions/upgrading-the-existing-database-in-a-php-system-1/</link>
<comments>http://www.globberstack.com/Questions/upgrading-the-existing-database-in-a-php-system-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:42:40 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/upgrading-the-existing-database-in-a-php-system-1/</guid>
<description><![CDATA[<br />            <p>I'm working on a software solution which was written using PHP Symfony with mysql database. When we do upgrades to the existing product what we use now is copping the existing database to a new database and do the upgrade standing on the new database. But the current method of asking the user to copy the existing database is not seems the professional way to do an upgrade. </p><br /><br /><p>Is there any standard way of doing that automatically and preserve the consistency of the old database. Please help me on this issue. Thanks in advance.  </p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/288135" rel="nofollow">Thilanka</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[MySQL database keeps crashing on replication slave issues, without actually being a slave]]></title>
<link>http://www.globberstack.com/Questions/mysql-database-keeps-crashing-on-replication-slave-issues-without-actually-being-a-slave-1/</link>
<comments>http://www.globberstack.com/Questions/mysql-database-keeps-crashing-on-replication-slave-issues-without-actually-being-a-slave-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:42:30 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/mysql-database-keeps-crashing-on-replication-slave-issues-without-actually-being-a-slave-1/</guid>
<description><![CDATA[<br />            <p>I have a mysql process on machine A which may at one time ran one of the databases as slave to a specific master database (B).</p><br /><br /><p>I set up a different slave on another machine (C), so on the problem machine A I ran <code>RESET SLAVE</code> and <code>STOP SLAVE</code> on.</p><br /><br /><p>Running <code>SHOW SLAVE STATUS</code> gets me <code>Empty set</code> for all databases on A.</p><br /><br /><p>The problem is that mysql on A keeps crashing:</p><br /><br /><pre><code>120204 20:20:39  mysqld restarted<br />InnoDB: The log sequence number in ibdata files does not match<br />InnoDB: the log sequence number in the ib_logfiles!<br />120204 20:20:40  InnoDB: Database was not shut down normally!<br />InnoDB: Starting crash recovery.<br />InnoDB: Reading tablespace information from the .ibd files...<br />InnoDB: Restoring possible half-written data pages from the doublewrite<br />InnoDB: buffer...<br />InnoDB: In a MySQL replication slave the last master binlog file<br />InnoDB: position 0 608674962, file name mysql-bin.000004<br />120204 20:20:45  InnoDB: Started; log sequence number 7 3284755002<br />120204 20:20:51 [Note] /usr/libexec/mysqld: ready for connections.<br />Version: '5.0.77'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution<br /><br />Number of processes running now: 0<br />120204 20:21:00  mysqld restarted<br />InnoDB: Log scan progressed past the checkpoint lsn 7 3284755002<br />120204 20:21:01  InnoDB: Database was not shut down normally!<br />InnoDB: Starting crash recovery.<br />InnoDB: Reading tablespace information from the .ibd files...<br />InnoDB: Restoring possible half-written data pages from the doublewrite<br />InnoDB: buffer...<br />InnoDB: Doing recovery: scanned up to log sequence number 7 3284755012<br />InnoDB: In a MySQL replication slave the last master binlog file<br />InnoDB: position 0 608674962, file name mysql-bin.000004<br />120204 20:21:05  InnoDB: Started; log sequence number 7 3284755012<br />120204 20:21:07 [Note] /usr/libexec/mysqld: ready for connections.<br />Version: '5.0.77'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution<br /><br />Number of processes running now: 0<br />120204 20:25:43  mysqld restarted<br />InnoDB: The log sequence number in ibdata files does not match<br />InnoDB: the log sequence number in the ib_logfiles!<br />120204 20:25:43  InnoDB: Database was not shut down normally!<br />InnoDB: Starting crash recovery.<br />InnoDB: Reading tablespace information from the .ibd files...<br />InnoDB: Restoring possible half-written data pages from the doublewrite<br />InnoDB: buffer...<br />InnoDB: In a MySQL replication slave the last master binlog file<br />InnoDB: position 0 608674962, file name mysql-bin.000004<br />120204 20:25:46  InnoDB: Started; log sequence number 7 3284756054<br />120204 20:25:47 [Note] /usr/libexec/mysqld: ready for connections.<br />Version: '5.0.77'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution<br /><br />Number of processes running now: 0<br />120204 20:29:21  mysqld restarted<br />InnoDB: The log sequence number in ibdata files does not match<br />InnoDB: the log sequence number in the ib_logfiles!<br />120204 20:29:22  InnoDB: Database was not shut down normally!<br />InnoDB: Starting crash recovery.<br />InnoDB: Reading tablespace information from the .ibd files...<br />InnoDB: Restoring possible half-written data pages from the doublewrite<br />InnoDB: buffer...<br />InnoDB: In a MySQL replication slave the last master binlog file<br /></code></pre><br /><br /><p>How can I fix this?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/925576" rel="nofollow">Ian.mc</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Is there any php-ga ports to Ruby on Rails]]></title>
<link>http://www.globberstack.com/Questions/is-there-any-php-ga-ports-to-ruby-on-rails-1/</link>
<comments>http://www.globberstack.com/Questions/is-there-any-php-ga-ports-to-ruby-on-rails-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:39:23 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/is-there-any-php-ga-ports-to-ruby-on-rails-1/</guid>
<description><![CDATA[<br />            <p>I'm looking for RoR solution to register direct redirects from my site, php-ga looks good but it is PHP.</p><br /><br /><p>I mean I have some <code>controller#redirect</code> action which makes smth like this</p><br /><br /><pre><code>def redirect<br />  link = Links.find_by_key params[:key]<br /><br />  redirect_to link.url<br />end<br /></code></pre><br /><br /><p>That makes flawless redirects from <code>http://myurl.com/XXX</code> to target location for any external references.</p><br /><br /><p>I definitely do not want to use real redirect page with JS code. And PHP-GA ( <a href="http://code.google.com/p/php-ga/" rel="nofollow">http://code.google.com/p/php-ga/</a> )  looks like the only prod-level and documented solution to register visits in Google Analytics directly from controller, but it's on PHP.</p><br /><br /><p>So, I return to my original question: <em>Is there any php-ga ports to Ruby on Rails?</em></p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/726140" rel="nofollow">Wile E.</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[SQLStateConverter.handledNonSpecificException hibernate ]]></title>
<link>http://www.globberstack.com/Questions/sqlstateconverter-handlednonspecificexception-hibernate--1/</link>
<comments>http://www.globberstack.com/Questions/sqlstateconverter-handlednonspecificexception-hibernate--1/</comments>
<pubDate>Sun, 05 Feb 2012 09:38:47 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/sqlstateconverter-handlednonspecificexception-hibernate--1/</guid>
<description><![CDATA[<br />            <p>I have the following entity in Hibernate:</p><br /><br /><pre><code>@Entity<br />public class Contact implements Serializable {<br />    private static final long serialVersionUID = 1L;<br />      @Temporal(TemporalType.DATE)<br />    private Date birthday;<br />}<br /></code></pre><br /><br /><p>When I call this method of hibernate:</p><br /><br /><pre><code>public Object get(Class entityClass, Serializable id) throws HibernateException {<br />    return get( entityClass.getName(), id );<br />}<br /></code></pre><br /><br /><p>I get the following exception:</p><br /><br /><pre><code>org.hibernate.exception.GenericJDBCException: could not load an entity: [com.mycompany.model.Contact#3]<br />    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)<br />    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)<br />}<br /></code></pre><br /><br /><p>I tried this simple code:</p><br /><br /><pre><code>Statement st = conn.createStatement();<br />ResultSet res = st.executeQuery("select registration_date from contact where contact_id=3");<br />Date i = res.getDate(1);<br /></code></pre><br /><br /><p>And this works fine.</p><br /><br /><p>What is the problem?</p><br /><br /><p>The type of <code>Date</code> is <code>java.util.Date</code> in both cases.</p><br /><br /><p><strong>EDITED</strong></p><br /><br /><p>I debugged it more, and saw that the exception is:</p><br /><br /><pre><code>Bad format for DATE '517' in column 2.<br /></code></pre><br /><br /><p>The date there is: 1985-05-17</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/264419" rel="nofollow">Odelya</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[php get string from remote page]]></title>
<link>http://www.globberstack.com/Questions/php-get-string-from-remote-page-1/</link>
<comments>http://www.globberstack.com/Questions/php-get-string-from-remote-page-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:36:13 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/php-get-string-from-remote-page-1/</guid>
<description><![CDATA[<br />            <p>I'm creating a mobile payment processing script for my site, and to validate the payment I have to grab a string from the providers site.</p><br /><br /><p>The string will be either "Valid" or "Invalid"</p><br /><br /><p>How can I pull this string from my own site?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1022585" rel="nofollow">user1022585</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[What datatype should I use to store time() in MySQL for my application?]]></title>
<link>http://www.globberstack.com/Questions/what-datatype-should-i-use-to-store-time-in-mysql-for-my-application-1/</link>
<comments>http://www.globberstack.com/Questions/what-datatype-should-i-use-to-store-time-in-mysql-for-my-application-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:32:07 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/what-datatype-should-i-use-to-store-time-in-mysql-for-my-application-1/</guid>
<description><![CDATA[<br />            <p>I plan to capture the start and end of user initiated activities on my website using time() in php. I'm not sure if this is the best way to capture start/end times. Anyway, the data will be stored in MySQL, but again I'm not sure what datatype I should use.<br />Based on the answers I've read on stackoverflow, the datatype used depends on the purpose of the application. </p><br /><br /><p><strong>Purpose of the application</strong></p><br /><br /><ol><br /><li>At it's simplest, I want to record start, stop (and duration) of an<br />activity. Probably using time().</li><br /><li>At it's most complicated I'd like to plot statistics based on when<br />the user did a certain activity, how much time they spent doing the<br />activity (in total), and when they were the most successful/least<br />successful etc, etc. (all based on the start/end times) Something to<br />keep in mind. The users will be from all over the world.</li><br /></ol><br /><br /><p><strong>MORE INFO</strong><br />If an activity is repeated a new record will be made for it. Records will not be updated.</p><br /><br /><p>At first, I had planned on storing unix timestamps in MySQL (as an integer datatype?), but from what I understand this is a bad idea, because I will lose a lot of MySQLs ability to process the information. If I store the information as DATETIME, but then move the server, all the times will change based on the local time of the server. Something I found confusing was that TIMESTAMP in MySQL is not the same as a unix timestamp- which is what I would be getting if I used time().</p><br /><br /><p>I'm aware that the unix timestamp can only hold dates up to 2038 for some systems, but that isn't a concern (at the moment).</p><br /><br /><p><strong>Question:</strong> Should I use time() to capture start and end times for user initiated activities? Based on the purpose of the application, <code>what datatype should I use to store the start and stop of user initiated activities?</code></p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/691053" rel="nofollow">moomoochoo</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[PHP - Yii - I can access model's data in a view file, but have the getUrl in its controller. How do i access this?]]></title>
<link>http://www.globberstack.com/Questions/php-yii-i-can-access-models-data-in-a-view-file-but-have-the-geturl-in-its-controller-how-do-i-access-this-1/</link>
<comments>http://www.globberstack.com/Questions/php-yii-i-can-access-models-data-in-a-view-file-but-have-the-geturl-in-its-controller-how-do-i-access-this-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:31:10 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/php-yii-i-can-access-models-data-in-a-view-file-but-have-the-geturl-in-its-controller-how-do-i-access-this-1/</guid>
<description><![CDATA[<br />            <p>PHP - Yii - I can access model's data in a view file, but have the getUrl in its controller. How do i access this?</p><br /><br /><p>basically, in yii, i have a model and controller set up. in the controller for a certain models (videos) i have a function called getUrl.</p><br /><br /><p>on the homepage i've edited the view to include the latest posts. i do this in <strong>views/site/index.php</strong> with:</p><br /><br /><pre><code>    &lt;?php $this-&gt;widget('LatestVideos'); ?&gt;<br /></code></pre><br /><br /><p>and the LatestVideos widget has this code:</p><br /><br /><pre><code>&lt;?<br /><br />Yii::import('zii.widgets.CPortlet');<br /><br />class LatestVideos extends CPortlet {<br />public $title='Tags';<br />public $maxVideos = 20;<br />protected function renderContent() {<br />    $criteria = new CDbCriteria;<br />    $criteria-&gt;limit=$maxVideos;        <br />    $vids = Video::model()-&gt;findAll();<br />    foreach($vids as $video) {<br />        $link = Yii::app()-&gt;createUrl('video/view', array(<br />            'id'=&gt;$video-&gt;id,<br />            'title'=&gt;$video-&gt;video_title,<br />        ));<br />        echo '&lt;a href="' . $link . '"&gt;' . $video-&gt;video_title . '&lt;/a&gt;';<br />    }<br /></code></pre><br /><br /><p>as you can see, in that widget i get the info about latest videos by going straight from the widget to the model. i skip the controller. i need to access the controller to propperly access the getUrl function. how do i do this?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1190646" rel="nofollow">notsid</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to open links in an iframe with target=“_blank” in the same iframe?]]></title>
<link>http://www.globberstack.com/Questions/how-to-open-links-in-an-iframe-with-target-“-blank”-in-the-same-iframe-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-open-links-in-an-iframe-with-target-“-blank”-in-the-same-iframe-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:29:25 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-open-links-in-an-iframe-with-target-“-blank”-in-the-same-iframe-1/</guid>
<description><![CDATA[<br />            <p>I want to Open links with target="_blank" and  an iframe  in the same iframe. <br />I tried the code below, but it didn't work:</p><br /><br /><pre><code>&lt;script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;<br /><br /><br />&lt;iframe src="http://www.htmlcodetutorial.com/linking/_A_TARGET_95y98y108y97y110y107y.html" height="100%" width="100%" &gt;&lt;/iframe&gt;<br /><br />&lt;script&gt;<br />$('iframe a[target="_blank"]').live('click',function(e){<br />e.preventDefault(); //stops it opening in a new window<br />var url = $(this).attr('href');<br />$('iframe').load(url);<br />});<br /><br />&lt;/script&gt;<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/915666" rel="nofollow">user915666</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[php extract info from a html page]]></title>
<link>http://www.globberstack.com/Questions/php-extract-info-from-a-html-page-1/</link>
<comments>http://www.globberstack.com/Questions/php-extract-info-from-a-html-page-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:26:04 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/php-extract-info-from-a-html-page-1/</guid>
<description><![CDATA[<br />            <p>I have this code </p><br /><br /><pre><code>&lt;input type=hidden name="code1" value="AA-T5301"&gt;<br />    &lt;tr&gt;<br />        &lt;td align=left valign=middle class="stdtext"&gt;<br />            AA-T5301<br />        &lt;/a&gt;<br />        &lt;/td&gt;<br />        &lt;td valign=middle align=left class="stdtext"&gt;<br />            &lt;a onMouseOver="window.status='See the more info on '; return true"<br />                HREF="product.asp?ms=&amp;dept_id=322&amp;sku=32&amp;nav="&gt;<br />                Grapeseed Oil 150ml<br />            &lt;/A&gt;<br />        &lt;/td&gt;<br />        &lt;td valign=middle align=right class="stdtext"&gt;Order Now&lt;/td&gt;<br />        &lt;td valign=middle align=right class="stdtext"&gt;<br />            &lt;font class="productsale"&gt;<br />                &lt;strike&gt;£3.04&lt;/strike&gt;<br />                &amp;#160;<br />            &lt;/font&gt;<br />            £2.04<br />        &lt;/td&gt;<br />        &lt;td valign=middle align=right class="stdtext"&gt;<br />            &lt;input type=text size=4 name="qty_AA-T5301" value="0"&gt;<br />        &lt;/td&gt;<br />    &lt;/tr&gt;<br />    &lt;input type=hidden name="code2" value="AA-T5302"&gt;<br />        &lt;tr&gt;<br />            &lt;td align=left valign=middle class="stdtext"&gt;<br />                AA-T5302<br />            &lt;/a&gt;<br />            &lt;/td&gt;<br />            &lt;td valign=middle align=left class="stdtext"&gt;<br />                &lt;a onMouseOver="window.status='See the more info on '; return true"<br />                    HREF="product.asp?ms=&amp;dept_id=322&amp;sku=143&amp;nav="&gt;<br />                    Grapeseed Oil 500ml<br />                &lt;/A&gt;<br />            &lt;/td&gt;<br />            &lt;td valign=middle align=right class="stdtext"&gt;Order Now&lt;/td&gt;<br />            &lt;td valign=middle align=right class="stdtext"&gt;<br />                &lt;font class="productsale"&gt;<br />                    &lt;strike&gt;£6.46&lt;/strike&gt;<br />                    &amp;#160;<br />                &lt;/font&gt;<br />                £4.33<br />            &lt;/td&gt;<br />            &lt;td valign=middle align=right class="stdtext"&gt;<br />                &lt;input type=text size=4 name="qty_AA-T5302" value="0"&gt;<br />            &lt;/td&gt;<br />        &lt;/tr&gt;<br />        &lt;input type=hidden name="code3" value="AA-T530"&gt;<br />            &lt;tr&gt;<br />                &lt;td align=left valign=middle class="stdtext"&gt;<br />                    AA-T530<br />                &lt;/a&gt;<br />                &lt;/td&gt;<br />                &lt;td valign=middle align=left class="stdtext"&gt;<br />                    &lt;a onMouseOver="window.status='See the more info on '; return true"<br />                        HREF="product.asp?ms=&amp;dept_id=322&amp;sku=19&amp;nav="&gt;<br />                        Grapeseed Oil 50ml<br />                    &lt;/A&gt;<br />                &lt;/td&gt;<br />                &lt;td valign=middle align=right class="stdtext"&gt;Out of Stock&lt;/td&gt;<br />                &lt;td valign=middle align=right class="stdtext"&gt;<br />                    &lt;font class="productsale"&gt;<br />                        &lt;strike&gt;£1.75&lt;/strike&gt;<br />                        &amp;#160;<br />                    &lt;/font&gt;<br />                    £1.17<br />                &lt;/td&gt;<br />                &lt;td valign=middle align=right class="stdtext"&gt;<br />                    &lt;input type=text size=4 name="qty_AA-T530" value="0"&gt;<br />                &lt;/td&gt;<br />            &lt;/tr&gt;<br /></code></pre><br /><br /><p>How can i extract the info into an array so i have something like this..</p><br /><br /><pre><code>product_code_array=(AA-T5301,AA-T5302,AA-T530);<br /><br />RRP_array=(3.04,6.46,1.75);<br /><br />price_array=(2.04,4.33,1.17);<br /></code></pre><br /><br /><p>Note: There maybe more than 3 items on a page at a time or there may only be 1</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/626990" rel="nofollow">Stu</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[split string into array and trim middle?]]></title>
<link>http://www.globberstack.com/Questions/split-string-into-array-and-trim-middle-1/</link>
<comments>http://www.globberstack.com/Questions/split-string-into-array-and-trim-middle-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:26:00 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/split-string-into-array-and-trim-middle-1/</guid>
<description><![CDATA[<br />            <p>I have a string that is something like this:</p><br /><br /><pre><code>$str="<br /><br />&lt;code&gt;<br /><br />  lol<br />      test<br /><br />&lt;/code&gt;<br /><br />test";<br /></code></pre><br /><br /><p>I want to trim the text that is within the tags so that I end up with this:</p><br /><br /><pre><code>$str="<br /><br />&lt;code&gt;lol<br />      test&lt;/code&gt;<br /><br />test";<br /></code></pre><br /><br /><p>Is there a way that I can split this out in to a 3 array pieces and so a simple trim() on the text in the middle?</p><br /><br /><p>many thanks</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/296346" rel="nofollow">Tim</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Validate form before submitted (Check all fields are entered)]]></title>
<link>http://www.globberstack.com/Questions/validate-form-before-submitted-check-all-fields-are-entered-1/</link>
<comments>http://www.globberstack.com/Questions/validate-form-before-submitted-check-all-fields-are-entered-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:25:47 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/validate-form-before-submitted-check-all-fields-are-entered-1/</guid>
<description><![CDATA[<br />            <p>I'm trying to check that the fields in the form below have been filled before it can be inserted into a database e.g. display a pop up with the fields that have not been filled in. It is just a simple Registration form.</p><br /><br /><pre><code>&lt;form name="form1" method="post" action="signup_ac.php"&gt;<br />&lt;strong&gt;Sign up&lt;/strong&gt;<br />Username:&lt;input name="username" type="text" id="username" size="30"&gt;<br />Password:&lt;input name="password" type="password" id="password" size="15"&gt;<br />Name:&lt;input name="name" type="text" id="name" size="30"&gt;<br />&lt;select name="Month"&gt;<br />&lt;option selected&gt;Month&lt;/option&gt;<br />&lt;option value="January"&gt;January&lt;/option&gt;<br />&lt;option value="Febuary"&gt;Febuary&lt;/option<br />  &lt;/select&gt; <br />&lt;select name=Year&gt;<br />&lt;option selected&gt;Year&lt;/option&gt;<br />&lt;option value="2012"&gt;2012&lt;/option&gt;<br />&lt;option value="2011"&gt;2011&lt;/option&gt;<br /> &lt;/select&gt;<br />&lt;input type="submit" name="Submit" value="Submit"&gt; &amp;nbsp;<br />&lt;input type="reset" name="Reset" value="Reset"&gt;<br />&lt;/form&gt;<br /></code></pre><br /><br /><p>How do I do this using JavaScript or jQuery. </p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/888457" rel="nofollow">Droid_Interceptor</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Illegal Start of Expression Error]]></title>
<link>http://www.globberstack.com/Questions/illegal-start-of-expression-error-1/</link>
<comments>http://www.globberstack.com/Questions/illegal-start-of-expression-error-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:22:57 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/illegal-start-of-expression-error-1/</guid>
<description><![CDATA[Hey I'm new here so sorry if I'm posting this in the wrong section or something like that. <br /> <br />But does anybody know what's wrong with this code, just can't seem to figure it out: <br /> <br /> <br /> <br />/**This class mimics a random guy character which could be used...<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Libevent timeout loop exit]]></title>
<link>http://www.globberstack.com/Questions/libevent-timeout-loop-exit-1/</link>
<comments>http://www.globberstack.com/Questions/libevent-timeout-loop-exit-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:21:40 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/libevent-timeout-loop-exit-1/</guid>
<description><![CDATA[<br />            <p>I'm having some difficulties getting the PHP libevent extension to break out of a loop on a timeout.  Here's what I've got so far based on the demos on the PHP.net docs pages:</p><br /><br /><pre><code>// From here: http://www.php.net/manual/en/libevent.examples.php<br /><br />function print_line($fd, $events, $arg) {<br />    static $max_requests = 0;<br />    $max_requests++;<br /><br />    printf("Received event: %s after %s\n%s", implode(getEventFlags($events)), getTimer(), fgets($fd));<br /><br />    if ($max_requests == 10) {<br />        // exit loop after 3 writes<br />        echo " [EXIT]\n";<br />        event_base_loopexit($arg[1]);<br />    }<br />}<br /><br />// create base and event<br />$base = event_base_new();<br />$event = event_new();<br /><br /><br />getTimer(); // Initialise time<br /><br />$fd = STDIN;<br />event_set($event, $fd, EV_READ | EV_PERSIST, "print_line", array($event, $base));<br />event_base_set($event, $base);<br />event_add($event, 2000000);<br />event_base_loop($base);<br /><br />// extract flags from bitmask<br />function getEventFlags ($ebm) {<br />    $expFlags = array('EV_TIMEOUT', 'EV_SIGNAL', 'EV_READ', 'EV_WRITE', 'EV_PERSIST');<br />    $ret = array();<br />    foreach ($expFlags as $exf) {<br />        if ($ebm &amp; constant($exf)) {<br />            $ret[] = $exf;<br />        }<br />    }<br />    return $ret;<br />}<br /><br />// Used to track time!<br />function getTimer () {<br />    static $ts;<br />    if (is_null($ts)) {<br />        $ts = microtime(true);<br />        return "Timer initialised";<br />    }<br />    $newts = microtime(true);<br />    $r = sprintf("Delta: %.3f", $newts - $ts);<br />    $ts = $newts;<br />    return $r;<br />}<br /></code></pre><br /><br /><p>I can see that the timeout value passed to <code>event_add</code> effects the events passed to print_line(), if these events are any more than 2 seconds apart I get an <code>EV_TIMEOUT</code> instead of an <code>EV_READ</code>.  What I want however is for libevent to call <code>print_line</code> as soon as the timeout is reached rather than waiting for the next event in order to give me the timeout.</p><br /><br /><p>I've tried using <code>event_base_loopexit($base, 2000000)</code>, this causes the event loop to exit immediately without blocking for events.  I've also tried passing <code>EV_TIMEOUT</code> to <code>event_set</code>, this seems to have no effect at all.</p><br /><br /><p>Has anyone managed to get this working before?  I know that the event_buffer_* stuff works with timeouts, however I want to use the standard <code>event_base</code> functions.  One of the <a href="https://bugs.php.net/bug.php?id=59627" rel="nofollow">PECL bugs</a> talks about event_timer_* functions and these functions do exist on my system, however they're not documented at all.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/408003" rel="nofollow">Robin</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Mysql stored procedure array parameter from java]]></title>
<link>http://www.globberstack.com/Questions/mysql-stored-procedure-array-parameter-from-java-1/</link>
<comments>http://www.globberstack.com/Questions/mysql-stored-procedure-array-parameter-from-java-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:19:03 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/mysql-stored-procedure-array-parameter-from-java-1/</guid>
<description><![CDATA[<br />            <p>I need to create mysql stored procedure which makes more than one insert at a time. To prevent many calls to database I need to use stored procedure. I have <code>java.util.List&lt;MyEntity&gt;</code> object of my data. <code>MyEntity</code> is an object which holds data which has to be inserted into table. </p><br /><br /><p>My question is how should I pass List object as mysql procedure parameter?</p><br /><br /><p>Thanks in advance.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1147529" rel="nofollow">Paulius Matulionis</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[mysql loader error? 'C:test.txt' not found (Errcode: 2)]]></title>
<link>http://www.globberstack.com/Questions/mysql-loader-error-ctest-txt-not-found-errcode-2-1/</link>
<comments>http://www.globberstack.com/Questions/mysql-loader-error-ctest-txt-not-found-errcode-2-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:17:09 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/mysql-loader-error-ctest-txt-not-found-errcode-2-1/</guid>
<description><![CDATA[<br />            <p>I tried the following code to load data from text document to mysql database, but it shows an error: ( file name is test.txt)</p><br /><br /><p>File 'C:test.txt' not found (Errcode: 2)<br />please help me......</p><br /><br /><p>LOAD DATA LOCAL INFILE 'C:test.txt' INTO TABLE messagebox  fields terminated by ','  LINES TERMINATED BY '\n';</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1148952" rel="nofollow">user1148952</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Get all values from a multidimensional array into a single array [closed]]]></title>
<link>http://www.globberstack.com/Questions/get-all-values-from-a-multidimensional-array-into-a-single-array-closed-1/</link>
<comments>http://www.globberstack.com/Questions/get-all-values-from-a-multidimensional-array-into-a-single-array-closed-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:16:44 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/get-all-values-from-a-multidimensional-array-into-a-single-array-closed-1/</guid>
<description><![CDATA[<br />            <blockquote><br />  <p><strong>Possible Duplicate:</strong><br><br />  <a href="http://stackoverflow.com/questions/1319903/how-to-flatten-a-multidimensional-array">How to Flatten a Multidimensional Array?</a>  </p><br /></blockquote><br /><br /><br /><br /><p>THe array:</p><br /><br /><pre><code>itemA =&gt; value<br />  itemA1 =&gt; value<br />  itemA2 =&gt; value<br />    itemA11 =&gt; value<br />itemB =&gt; value<br /><br />and so on...<br /></code></pre><br /><br /><p>How can I get the values gathered like this:</p><br /><br /><pre><code>[0] =&gt; value (from itemA)<br />[1] =&gt; value (from itemA1)<br />[2] =&gt; value (from itemA2)<br />[3] =&gt; value (from itemA11)<br />[4] =&gt; value (from itemB)<br />...<br /></code></pre><br /><br /><p>?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1190692" rel="nofollow">user1190692</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to insert over a million records into a MySQL database?]]></title>
<link>http://www.globberstack.com/Questions/how-to-insert-over-a-million-records-into-a-mysql-database-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-insert-over-a-million-records-into-a-mysql-database-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:16:16 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-insert-over-a-million-records-into-a-mysql-database-1/</guid>
<description><![CDATA[<br />            <p>I have a sql file which contains over a million insert statements. The official tool for MySQL administration is not able to open it because of its size. Is it possible to insert records using a BASH script?</p><br /><br /><p>I tried this so far but it doesn't work. </p><br /><br /><pre><code>while read line<br />do<br />    mysql -u root --password=root &lt;&lt; eof<br />    use dip;<br />    $line;<br />    eof<br />done &lt; $1<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/419516" rel="nofollow">Tomas</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to retrieve 1 record at a time from db]]></title>
<link>http://www.globberstack.com/Questions/how-to-retrieve-1-record-at-a-time-from-db-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-retrieve-1-record-at-a-time-from-db-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:15:58 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-retrieve-1-record-at-a-time-from-db-1/</guid>
<description><![CDATA[<br />            <p>I have a table comment as follow: </p><br /><br /><p><strong>Comment</strong></p><br /><br /><pre><code>comment_id         cmt               followupid<br />1                 Hello              3 <br />2                 hi                 4<br />3                 Hey                2<br />4                 wassup             1<br /></code></pre><br /><br /><p>My query is that I want to echo "Hello", "hi", "hey" , "Wassup" and other (the record continues) individualy, I have used </p><br /><br /><pre><code>$comment = mysql_result($runQuery, $i,"cmt");<br />echo $comment; <br /></code></pre><br /><br /><p>which works fine but the problem is that it echoes all the comments at once, what I want is to echo all the comment but one at a time.  the comment are in  a div tag such that each the div appears only after 1 second the page is loaded. I want each comment to appear after different time interval </p><br /><br /><p>for e.g: </p><br /><br /><pre><code>Hello  to appear at        5pm    (not necessarily the corect time it can be just an int)<br />hi                         5.10 pm <br />hey                        6.30 pm <br /></code></pre><br /><br /><p>Please Help!</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1010675" rel="nofollow">FacebookUse</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[UDP Attack on Gaming Server]]></title>
<link>http://www.globberstack.com/Questions/udp-attack-on-gaming-server-1/</link>
<comments>http://www.globberstack.com/Questions/udp-attack-on-gaming-server-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:14:02 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/udp-attack-on-gaming-server-1/</guid>
<description><![CDATA[Recently the business class server I use for a MMO Game has become under the attack of someone who has a semi-decent amount of knowledge of what they are doing.   <br /> <br />For the past couple of weeks they have initiated a UDP flood attack using a command...<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Symfony - image in response - speed, optimization]]></title>
<link>http://www.globberstack.com/Questions/symfony-image-in-response-speed-optimization-1/</link>
<comments>http://www.globberstack.com/Questions/symfony-image-in-response-speed-optimization-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:13:40 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/symfony-image-in-response-speed-optimization-1/</guid>
<description><![CDATA[<br />            <p>I generate dynamically graphic in my controller:</p><br /><br /><ol><br /><li><p>if not file exists (unique filename) then generate graphic and save it</p></li><br /><li><p>return RedirectResponse($url)</p></li><br /></ol><br /><br /><p>(3. I've tried also:</p><br /><br /><pre><code>    $fp = fopen($url, "rb");<br />    $str = stream_get_contents($fp);<br />    fclose($fp);<br /><br />    $response = new Response($str, 200);<br />    $response-&gt;headers-&gt;set('Content-Type', 'image/png');<br />    return $response;<br /></code></pre><br /><br /><p>)</p><br /><br /><p>I need it to generate dynamically userbars for users [on this graphic some text will be automatically updating if some changes will be done on my websites]. </p><br /><br /><p>So it's important for me that this script works fast and doesn't kill my server/bandwitch. To achieve that I've made cache where all generated graphics are stored. But i've got a problem with speed, solutions which i've described above are pretty slow, when i've tested it in chrome with developer tool (F12) then it shows me that both solution (2. and 3.) takes about ~1s (when the same graphics [without controllers etc. just direct url to .png] loads 44ms). </p><br /><br /><p>So if only for me it takes about ~1s per graphic then if for example 1000 users will generate at the same time this graphic it can slower my website I think.</p><br /><br /><p>Please help, do you know any faster ways to do that?</p><br /><br /><p>PS. Redirect isn't most desire thing for me, because I would prefer to leave url as it is, for example smth/username/userbar/ insted of smth/img/userbars/cache/blabla.png. But if it will be much faster then I can stand it :).</p><br /><br /><p>EDIT: To be clear: I'm not looking for solution to cache images, my problem is that returning images via controller (already generated images, just from ftp) takes about 1s, when normally if you do for example </p><br /><br /><pre><code>           &lt;img src="direct_url_to_png"&gt; <br /></code></pre><br /><br /><p>it takes about 44ms.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1080578" rel="nofollow">Wojciech Kulik</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[[SOLVED] Less width]]></title>
<link>http://www.globberstack.com/Questions/solved-less-width-1/</link>
<comments>http://www.globberstack.com/Questions/solved-less-width-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:13:07 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/solved-less-width-1/</guid>
<description><![CDATA[Hi  <br /> <br />is there a way whereby I can make the width of the following template narrower ? I mean for me at least it is too wide. Will appreciate your help :wink: <br /> <br />Fashion Magazine | Fashion - Free Website Template- TemplatesCreme.com (http://www.templatescreme.com/free-website-fashion-magazine) <br />...<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[limit the number of threads viewed on a page]]></title>
<link>http://www.globberstack.com/Questions/limit-the-number-of-threads-viewed-on-a-page-1/</link>
<comments>http://www.globberstack.com/Questions/limit-the-number-of-threads-viewed-on-a-page-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:12:25 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/limit-the-number-of-threads-viewed-on-a-page-1/</guid>
<description><![CDATA[<br />            <p>In forums, there is an option to choose to display the number of viewable threads on a single page, there is also links to view next pages that contain the same number of thread counts.I would like to learn how that is done in mysql and php.                                                                                            Date and pay me!I WILL DO.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1082493" rel="nofollow">Mackintoast</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[how to use sphider search engine in php mysql]]></title>
<link>http://www.globberstack.com/Questions/how-to-use-sphider-search-engine-in-php-mysql-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-use-sphider-search-engine-in-php-mysql-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:10:24 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-use-sphider-search-engine-in-php-mysql-1/</guid>
<description><![CDATA[<br />            <p>Now am developing a small website. I tried to use sphider search engine to get  data from my database. I'm using Xampp server, i Just extract that sphider files to htdocs document in xampp server. I have update that database name in sphider database.php files and so on. But when i try to search it shows the search did not match any document can any one give suggestion to solve this problem.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/574005" rel="nofollow">Dhinesh.B</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How do I get comment count in Disqus?]]></title>
<link>http://www.globberstack.com/Questions/how-do-i-get-comment-count-in-disqus-1/</link>
<comments>http://www.globberstack.com/Questions/how-do-i-get-comment-count-in-disqus-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:10:00 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-do-i-get-comment-count-in-disqus-1/</guid>
<description><![CDATA[<br />            <p>I'd like to store the Disqus comment count on my own database, so that I can sort my articles by comment count. Basically, every time a page is read on my site, I'd like to ask Disqus how many comments that certain page has, then update the database with that count.</p><br /><br /><p><a href="http://docs.disqus.com/help/3/" rel="nofollow">http://docs.disqus.com/help/3/</a> doesn't seem to be helpful.</p><br /><br /><p>Any suggestions?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/193375" rel="nofollow">Obay</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[how do I include a class in another file?]]></title>
<link>http://www.globberstack.com/Questions/how-do-i-include-a-class-in-another-file-1/</link>
<comments>http://www.globberstack.com/Questions/how-do-i-include-a-class-in-another-file-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:09:38 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-do-i-include-a-class-in-another-file-1/</guid>
<description><![CDATA[<br />            <p>I am new to object php, I have the following concern:<br />    is it possible to have one class included inside another class, and use it's method like:</p><br /><br /><p>in Anotherclass.php file</p><br /><br /><pre><code>  class Another<br /> {<br />    public $value = '';<br />    public function setValue($newvalue)<br />    {<br />      $this-&gt;value=$newvalue;<br />    }<br />    public function getValue()<br />    {<br />      return $this-&gt;value;<br />    }<br /><br /> }<br /></code></pre><br /><br /><p>in Bootstrap.php  file:</p><br /><br /><pre><code>  require(Another.inc)<br />  class Bootstrap<br /> {<br />    public static function main($value)<br />{<br />    $obj =  new Another();<br />        $obj-&gt;  setValue($value)<br />       echo  $obj-&gt;getValue();  <br /><br />     }<br /> }<br /><br /><br />  Bootstrap::main("test");<br /></code></pre><br /><br /><p>so when I call Bootstrap::main("test") in the Bootstrap.php file, can I get the output which is "test"? Any help will be greatly appreciated! </p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/971933" rel="nofollow">smith</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Mysql - Alter table statement to create unique index on long text field]]></title>
<link>http://www.globberstack.com/Questions/mysql-alter-table-statement-to-create-unique-index-on-long-text-field-1/</link>
<comments>http://www.globberstack.com/Questions/mysql-alter-table-statement-to-create-unique-index-on-long-text-field-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:04:11 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/mysql-alter-table-statement-to-create-unique-index-on-long-text-field-1/</guid>
<description><![CDATA[<br />            <p>I'm trying to create an <code>Alter</code> command to create an <code>unique_index</code> on the first 8000 characters.  I'm not able to figure out how to add the 8000 part.  Any help would be appreciated.  Thanks!</p><br /><br /><pre><code>ALTER TABLE nextractor.tblhtml<br />  ADD UNIQUE INDEX uniqueindex_InnerHTML (InnerHtml);<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/222427" rel="nofollow">Mike</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[geocode - get the location]]></title>
<link>http://www.globberstack.com/Questions/geocode-get-the-location-1/</link>
<comments>http://www.globberstack.com/Questions/geocode-get-the-location-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:03:20 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/geocode-get-the-location-1/</guid>
<description><![CDATA[<br />            <p>If I have a table with</p><br /><br /><pre><code>id, location, latitude, longitude<br /></code></pre><br /><br /><p>and I would have a location code: (13.779242,100.472915) for example.</p><br /><br /><p>! have 2 questions: what field type should I use for the lat and lon? Double? or maybe the spacial things? but isn't that more for calculating the distance?</p><br /><br /><p>Anyway, I want to find the location (or the one most accurate)<br />Am I thinking to easily if I would just do these 2 queries:</p><br /><br /><pre><code>Select * from location_table WHERE latitude &gt; 13.779242 AND longitude &gt; 100.472915." LIMIT 1"; // return as row 1<br />Select * from location_table WHERE latitude &lt; 13.779242 AND longitude &lt; 100.472915." LIMIT 1"; // return as row2<br /></code></pre><br /><br /><p>Then do a compare</p><br /><br /><pre><code>$lat_dis_1 = $row1-&gt;latitude - 13.779242;<br />$lat_dis_2 = 13.779242 - $row2-&gt;latitude;<br /><br />if ($lat_dis_1 &gt; $lat_dis_2) {<br />// row2 was closer<br />} else {<br />//row1 closer<br />}<br /></code></pre><br /><br /><p>and same for longitude... Or am i just thinking too simpel here?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/470164" rel="nofollow">renevdkooi</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Internal / External Email Notifications]]></title>
<link>http://www.globberstack.com/Questions/internal-external-email-notifications-1/</link>
<comments>http://www.globberstack.com/Questions/internal-external-email-notifications-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:02:56 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/internal-external-email-notifications-1/</guid>
<description><![CDATA[I have a website which is hosted by GoDaddy.com. For 6 months my Internal / External Email Notifications (New User Signup, Contact From Member, Auction End, Auction Begin, OutBid, Etc...) have been sent with no problem whatsoever until two weeks ago. I contacted GoDaddy and they stated that it was...<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to add uncovered files to PHPUnit code coverage report of the Yii application]]></title>
<link>http://www.globberstack.com/Questions/how-to-add-uncovered-files-to-phpunit-code-coverage-report-of-the-yii-application-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-add-uncovered-files-to-phpunit-code-coverage-report-of-the-yii-application-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:02:38 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-add-uncovered-files-to-phpunit-code-coverage-report-of-the-yii-application-1/</guid>
<description><![CDATA[<br />            <p>I am currently trying to get the code coverage report for a PHP application based on <a href="http://www.yiiframework.com/" rel="nofollow">Yii framework</a>.</p><br /><br /><p>Code coverage gets generated by <a href="http://www.phpunit.de/manual/3.6/en/code-coverage-analysis.html" rel="nofollow">PHPUnit 3.6</a>, and I am using <a href="http://www.phpunit.de/manual/3.6/en/code-coverage-analysis.html#code-coverage-analysis.including-excluding-files" rel="nofollow">whitelist approach</a> to source files filtering.</p><br /><br /><p>Problem is, when I set the option <code>addUncoveredFilesFromWhitelist="true"</code>, code coverage breaks with the following error: </p><br /><br /><pre><code>Generating code coverage report, this may take a moment.PHP Warning:  include(CButtonColumn.php): failed to open stream: No such file or directory in /home/hijarian/systems/yii/framework/YiiBase.php on line 418<br />PHP Stack trace:<br />PHP   1. {main}() /usr/bin/phpunit:0<br />PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46<br />PHP   3. PHPUnit_TextUI_Command-&gt;run() /usr/share/php/PHPUnit/TextUI/Command.php:125<br />PHP   4. PHPUnit_TextUI_TestRunner-&gt;doRun() /usr/share/php/PHPUnit/TextUI/Command.php:187<br />PHP   5. PHP_CodeCoverage_Report_HTML-&gt;process() /usr/share/php/PHPUnit/TextUI/TestRunner.php:373<br />PHP   6. PHP_CodeCoverage-&gt;getReport() /usr/share/php/PHP/CodeCoverage/Report/HTML.php:133<br />PHP   7. PHP_CodeCoverage_Report_Factory-&gt;create() /usr/share/php/PHP/CodeCoverage.php:141<br />PHP   8. PHP_CodeCoverage-&gt;getData() /usr/share/php/PHP/CodeCoverage/Report/Factory.php:65<br />PHP   9. PHP_CodeCoverage-&gt;processUncoveredFilesFromWhitelist() /usr/share/php/PHP/CodeCoverage.php:173<br />PHP  10. include_once() /usr/share/php/PHP/CodeCoverage.php:516<br />PHP  11. YiiBase::autoload() /home/hijarian/systems/yii/framework/YiiBase.php:0<br /><br />PHP Warning:  include(): Failed opening 'CButtonColumn.php' for inclusion (include_path='.:/home/hijarian/projects/lexgarant/webapp/protected/components:/home/hijarian/projects/lexgarant/webapp/protected/models:/usr/share/php:/usr/share/pear') in /home/hijarian/systems/yii/framework/YiiBase.php on line 418<br />PHP Stack trace:<br />PHP   1. {main}() /usr/bin/phpunit:0<br />PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46<br />PHP   3. PHPUnit_TextUI_Command-&gt;run() /usr/share/php/PHPUnit/TextUI/Command.php:125<br />PHP   4. PHPUnit_TextUI_TestRunner-&gt;doRun() /usr/share/php/PHPUnit/TextUI/Command.php:187<br />PHP   5. PHP_CodeCoverage_Report_HTML-&gt;process() /usr/share/php/PHPUnit/TextUI/TestRunner.php:373<br />PHP   6. PHP_CodeCoverage-&gt;getReport() /usr/share/php/PHP/CodeCoverage/Report/HTML.php:133<br />PHP   7. PHP_CodeCoverage_Report_Factory-&gt;create() /usr/share/php/PHP/CodeCoverage.php:141<br />PHP   8. PHP_CodeCoverage-&gt;getData() /usr/share/php/PHP/CodeCoverage/Report/Factory.php:65<br />PHP   9. PHP_CodeCoverage-&gt;processUncoveredFilesFromWhitelist() /usr/share/php/PHP/CodeCoverage.php:173<br />PHP  10. include_once() /usr/share/php/PHP/CodeCoverage.php:516<br />PHP  11. YiiBase::autoload() /home/hijarian/systems/yii/framework/YiiBase.php:0<br /><br />PHP Fatal error:  Class 'CButtonColumn' not found in /home/hijarian/projects/lexgarant/webapp/protected/components/CLexgarantButtonColumn.php on line 4<br />PHP Stack trace:<br />PHP   1. {main}() /usr/bin/phpunit:0<br />PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46<br />PHP   3. PHPUnit_TextUI_Command-&gt;run() /usr/share/php/PHPUnit/TextUI/Command.php:125<br />PHP   4. PHPUnit_TextUI_TestRunner-&gt;doRun() /usr/share/php/PHPUnit/TextUI/Command.php:187<br />PHP   5. PHP_CodeCoverage_Report_HTML-&gt;process() /usr/share/php/PHPUnit/TextUI/TestRunner.php:373<br />PHP   6. PHP_CodeCoverage-&gt;getReport() /usr/share/php/PHP/CodeCoverage/Report/HTML.php:133<br />PHP   7. PHP_CodeCoverage_Report_Factory-&gt;create() /usr/share/php/PHP/CodeCoverage.php:141<br />PHP   8. PHP_CodeCoverage-&gt;getData() /usr/share/php/PHP/CodeCoverage/Report/Factory.php:65<br />PHP   9. PHP_CodeCoverage-&gt;processUncoveredFilesFromWhitelist()     /usr/share/php/PHP/CodeCoverage.php:173<br />PHP  10. include_once() /usr/share/php/PHP/CodeCoverage.php:516<br /></code></pre><br /><br /><p>(It's interesting by itself, why there is three almost identical errors instead of just one.) When <code>addUncoveredFilesFromWhitelist="false"</code> code coverage generates successfully, but, of course, without the files not covered by tests.</p><br /><br /><p>Files of the Yii framework placed in the <code>$HOME/systems/yii/</code> directory.</p><br /><br /><p>Application I'm trying to cover placed in the <code>$HOME/projects/$APPNAME/</code>.</p><br /><br /><p>Here's my <code>phpunit.xml</code>:</p><br /><br /><pre><code>&lt;phpunit bootstrap="bootstrap.php"<br />    colors="true"<br />    convertErrorsToExceptions="true"<br />    convertNoticesToExceptions="true"<br />    convertWarningsToExceptions="true"<br />    stopOnFailure="false"&gt;<br /><br />&lt;filter&gt;<br />&lt;!-- DO NOT SET TO "true" CODE COVERAGE WILL BREAK --&gt;<br />  &lt;whitelist addUncoveredFilesFromWhitelist="false"&gt;<br />    &lt;directory suffix=".php"&gt;..&lt;/directory&gt;<br />    &lt;exclude&gt;<br />      &lt;directory suffix=".php"&gt;../config/&lt;/directory&gt;<br />      &lt;directory suffix=".php"&gt;../messages/&lt;/directory&gt;<br />      &lt;directory suffix=".php"&gt;../tests/&lt;/directory&gt;<br />      &lt;directory suffix=".php"&gt;../runtime/&lt;/directory&gt;<br />      &lt;directory suffix=".php"&gt;/home/hijarian/systems/yii/framework/&lt;/directory&gt;<br />    &lt;/exclude&gt;<br />  &lt;/whitelist&gt;<br />&lt;/filter&gt;<br /><br />&lt;logging&gt;<br />    &lt;log type="coverage-html" <br />        target="report/html" <br />        title="Lexgarant Online"<br />        charset="UTF-8" <br />        yui="true" <br />        highlight="true"<br />        lowUpperBound="35" highLowerBound="70" /&gt;<br />&lt;/logging&gt;<br /><br />&lt;testsuites&gt;<br />    &lt;testsuite name="All_Unit_Tests"&gt;<br />        &lt;directory&gt;./unit/models/&lt;/directory&gt;<br />        &lt;directory&gt;./unit/logic/&lt;/directory&gt;<br />        &lt;directory&gt;./unit/components/&lt;/directory&gt;<br />    &lt;/testsuite&gt;<br />&lt;/testsuites&gt;<br /><br />&lt;selenium&gt;<br />    &lt;browser name="Firefox" browser="*firefox" /&gt;<br />&lt;/selenium&gt;<br />&lt;/phpunit&gt;<br /></code></pre><br /><br /><p>I have all the tests placed under the <code>protected/tests</code> directory in the application's catalogue, as described in the <a href="http://www.yiiframework.com/doc/guide/1.1/en/test.overview#test-environment-setup" rel="nofollow">Test Environment Setup</a> in The Definitive Guide to Yii.</p><br /><br /><p>PHPUnit is invoked as follows:</p><br /><br /><pre><code>cd $APPDIR/protected/tests/<br />phpunit<br /></code></pre><br /><br /><p>The unit testing itself goes smoothly, only code coverage breaks. </p><br /><br /><p>Maybe I should set up the exlude list to exclude directories with Yii's classes, but I am somewhat afraid of this experience because there's dozens of folders, Yii is a highly modular system. Of course, if it's an only solution...</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/647199" rel="nofollow">hijarian</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[[SOLVED] Running EqualCols.js and LightBox.js won't seem to work!]]></title>
<link>http://www.globberstack.com/Questions/solved-running-equalcols-js-and-lightbox-js-wont-seem-to-work-1/</link>
<comments>http://www.globberstack.com/Questions/solved-running-equalcols-js-and-lightbox-js-wont-seem-to-work-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:01:50 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/solved-running-equalcols-js-and-lightbox-js-wont-seem-to-work-1/</guid>
<description><![CDATA[Ok, I'm building a website for a friend, I'm currently using jquery-1.2.6.min.js, corners.js, equalcols.js, and a pre-load image script in the head. Everything works great. <br /> <br />Problem is, I now need FancyBox (LightBox alternative) for a page and it won't seem to work! I know it's because something...<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[PHP remember me function doesn't work [closed]]]></title>
<link>http://www.globberstack.com/Questions/php-remember-me-function-doesnt-work-closed-1/</link>
<comments>http://www.globberstack.com/Questions/php-remember-me-function-doesnt-work-closed-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:00:36 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/php-remember-me-function-doesnt-work-closed-1/</guid>
<description><![CDATA[<br />            <p>I have a website and want to remember the session by checking the box.</p><br /><br /><p>I have a code to remember username and password, but it doesn't work when i restart my browser.</p><br /><br /><p>Here is the code: </p><br /><br /><pre><code>session_start();<br />session_regenerate_id();<br />$_SESSION['id'] = $id;<br />$_SESSION['mdid'] = $mdid;<br />$_SESSION['start'] = $start;<br />$_SESSION['firstname'] = $firstname;<br />$_SESSION['lastname'] = $lastname;<br />$_SESSION['username'] = $username;<br />$_SESSION['email'] = $email;<br />$_SESSION['password'] = $password;<br />$_SESSION['country'] = $country;<br />$_SESSION['city'] = $city;<br />$_SESSION['joined'] = $joined;<br />$_SESSION['activation'] = $activation;<br />$_SESSION['banned'] = $banned;<br />$_SESSION['ckey'] = $ckey;<br /><br />   // these above variables are from database.<br /><br /><br />$ctimee = time();<br />$ckeyy = rand(100000,999999);<br />mysql_query("UPDATE users SET ckey='$ckeyy', ctime='$ctimee' WHERE id='$id'");<br />$remember = $_POST['remember'];<br /><br />if($remember){<br />setcookie("id", $_SESSION['id'], time()+60*60*24*COOKIE_TIME_OUT, "/");<br /><br />}<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1190533" rel="nofollow">Sandro Vardiashvili</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[MySQL get Offset given Limit, Order By, and Where ID]]></title>
<link>http://www.globberstack.com/Questions/mysql-get-offset-given-limit-order-by-and-where-id-1/</link>
<comments>http://www.globberstack.com/Questions/mysql-get-offset-given-limit-order-by-and-where-id-1/</comments>
<pubDate>Sun, 05 Feb 2012 09:00:22 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/mysql-get-offset-given-limit-order-by-and-where-id-1/</guid>
<description><![CDATA[<br />            <p>I have a table that displays 10 rows per page.  Now, given an item's ID, how can I get the "page" that the item is on?</p><br /><br /><p>In other words, I'm looking for the offset (multiple of 10) given an ID of a record.</p><br /><br /><pre><code>SELECT * FROM items<br />WHERE category = "category"<br />LIMIT ?, 10      &lt;----- TRYING TO FIGURE OUT HOW TO GET ? OFFSET GIVEN ID<br />ORDER BY id DESC<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/536998" rel="nofollow">PeterCPWong</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Google search: Scrape results page in PHP for total results]]></title>
<link>http://www.globberstack.com/Questions/google-search-scrape-results-page-in-php-for-total-results-1/</link>
<comments>http://www.globberstack.com/Questions/google-search-scrape-results-page-in-php-for-total-results-1/</comments>
<pubDate>Sun, 05 Feb 2012 08:57:58 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/google-search-scrape-results-page-in-php-for-total-results-1/</guid>
<description><![CDATA[<br />            <p>Is it possible to scrape the Google search results page using PHP to pull out the total number of search results found?</p><br /><br /><p>If so how would I go about doing this?</p><br /><br /><p>Thanks</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/229558" rel="nofollow">Probocop</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Ruby on rails: mysql error]]></title>
<link>http://www.globberstack.com/Questions/ruby-on-rails-mysql-error-2/</link>
<comments>http://www.globberstack.com/Questions/ruby-on-rails-mysql-error-2/</comments>
<pubDate>Sun, 05 Feb 2012 08:55:03 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/ruby-on-rails-mysql-error-2/</guid>
<description><![CDATA[<br />            <p><strong>I'm using windows xp 32 pro, bit, sp3. the latest version of <a href="http://railsinstaller.org" rel="nofollow">railsinstaller</a>, and <code>mysql2 gem</code></strong></p><br /><br /><p>i have been trying to solve this error all this week. When i run <code>rake db:create</code> I see this error</p><br /><br /><p><img src="http://i.stack.imgur.com/n8q5k.jpg" alt="enter image description here"></p><br /><br /><p><a href="http://i1201.photobucket.com/albums/bb354/elieobeid7/rorerror2.jpg" rel="nofollow">this is what i see when i trace the error</a></p><br /><br /><p>i have solved this error by downloading <a href="http://dev.mysql.com/downloads/connector/c/" rel="nofollow">the zipped version of mysql Connector/C 6.0.2 for 32 bit</a> and copying <code>libmysql.dll</code> from <code>mysql-connector-c-noinstall-6.0.2-win32-vs2005\lib</code> </p><br /><br /><p>to <code>C:\RailsInstaller\Ruby1.9.2\bin</code></p><br /><br /><p>now when I run <code>rake db:create</code> i see</p><br /><br /><p><img src="http://i.stack.imgur.com/AGnpE.jpg" alt="enter image description here"></p><br /><br /><p><a href="http://i1201.photobucket.com/albums/bb354/elieobeid7/rorerror4.jpg" rel="nofollow">and this is what i see when i trace the error</a></p><br /><br /><p>i hope these info will help you, to help me solve the problem :)</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1072077" rel="nofollow">Someone Like You</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Retrieve date saved as string]]></title>
<link>http://www.globberstack.com/Questions/retrieve-date-saved-as-string-1/</link>
<comments>http://www.globberstack.com/Questions/retrieve-date-saved-as-string-1/</comments>
<pubDate>Sun, 05 Feb 2012 08:51:34 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/retrieve-date-saved-as-string-1/</guid>
<description><![CDATA[<br />            <p>I have dates in a database saved as varchar (11 September 2011). I am trying to make a query like this:</p><br /><br /><pre><code>$result=mysql_query("SELECT * FROM post WHERE YEAR(STR_TO_DATE(datum,'%e %M %Y') ='2011')") or die(mysql_error());<br /></code></pre><br /><br /><p>It's returning <code>NULL</code>.   </p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/480817" rel="nofollow">InTry</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Migrate C# Hash Code to PHP]]></title>
<link>http://www.globberstack.com/Questions/migrate-c-hash-code-to-php-1/</link>
<comments>http://www.globberstack.com/Questions/migrate-c-hash-code-to-php-1/</comments>
<pubDate>Sun, 05 Feb 2012 08:51:32 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/migrate-c-hash-code-to-php-1/</guid>
<description><![CDATA[<br />            <p>I know there are similar questions already on SO but none of them seem to address this problem. I have inherited the following c# code that has been used to create password hashes in a legacy .net app, for various reasons the C# implementation is now being migrated to php:</p><br /><br /><pre><code>string input = "fred";<br />SHA256CryptoServiceProvider provider = new SHA256CryptoServiceProvider();<br />byte[] hashedValue = provider.ComputeHash(Encoding.ASCII.GetBytes(input));<br />string output = "";<br />string asciiString = ASCIIEncoding.ASCII.GetString(hashedValue);<br />foreach ( char c in asciiString ) {<br />   int tmp = c;<br />   output += String.Format("{0:x2}", <br />             (uint)System.Convert.ToUInt32(tmp.ToString()));<br />}<br />return output;<br /></code></pre><br /><br /><p>My php code is very simple but for the same input "fred" doesn't produce the same result:</p><br /><br /><pre><code>$output = hash('sha256', "fred");<br /></code></pre><br /><br /><p>I've traced the problem down to an encoding issue - if I change this line in the C# code:</p><br /><br /><pre><code>string asciiString = ASCIIEncoding.ASCII.GetString(hashedValue);<br /></code></pre><br /><br /><p>to </p><br /><br /><pre><code>string asciiString = ASCIIEncoding.UTF7.GetString(hashedValue);<br /></code></pre><br /><br /><p>Then the php and C# output match (it yields d0cfc2e5319b82cdc71a33873e826c93d7ee11363f8ac91c4fa3a2cfcd2286e5).</p><br /><br /><p>Since I'm not able to change the .net code I need to work out how to replicate the results in php.</p><br /><br /><p>Thanks in advance for any help,</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1051913" rel="nofollow">davet</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Creating an object from an array of multiple values]]></title>
<link>http://www.globberstack.com/Questions/creating-an-object-from-an-array-of-multiple-values-1/</link>
<comments>http://www.globberstack.com/Questions/creating-an-object-from-an-array-of-multiple-values-1/</comments>
<pubDate>Sat, 04 Feb 2012 09:44:53 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/creating-an-object-from-an-array-of-multiple-values-1/</guid>
<description><![CDATA[<br />            <p>I have this function:</p><br /><br /><pre><code>function getPostInfo($query, $fields, $type, $limit, $since, $until, $lang, $stopwords, $identifier) {<br />$url = file_get_contents('https://graph.facebook.com/search?q='.spaces($query).'&amp;fields='.$fields.'&amp;limit='.$limit.'&amp;until='.$until);<br /> $j = json_decode($url);<br />  foreach($j-&gt;data as $v) {<br />  if ($v-&gt;type == $type) {<br />        $author_id = $v-&gt;from-&gt;id;<br />        $original_id = $v-&gt;id;<br />        $post_url = getPostUrl($original_id, $author_id);<br />        //$description = stopWords($v-&gt;message);<br />        $description = $v-&gt;message;<br />        $pub_date = $v-&gt;created_time;<br />        $post[]= array(<br />        'author_id' =&gt; $author_id, <br />        'orginal_id' =&gt; $original_id, <br />        'post_url' =&gt; $post_url, <br />        'descritpion' =&gt; $description, <br />        'pub_date' =&gt; $pub_date<br />        );<br />    }<br /> }  <br /> return (object)$post;<br />}<br /></code></pre><br /><br /><p>If I call for example:</p><br /><br /><pre><code>`$post = getPostInfo($query, $fields, $type, $limit, $since, $until, $lang, $stopwords, $identifier);<br /><br />echo $post-&gt;pub_date;` <br /></code></pre><br /><br /><p>it returns empty..</p><br /><br /><p>I tried to strip the [] from the $post array in the function...and in this case it returns only ONE value..</p><br /><br /><p>Instead it should return more values, because the object should get more values from the foreach loop in the above function..</p><br /><br /><p>But it's not happening..</p><br /><br /><p>I tried also to work with normal arrays, without an object, like this:</p><br /><br /><pre><code>$post = getPostInfo($query, $fields, $type, $limit, $since, $until, $lang, $stopwords, $identifier);<br /><br />echo $post['pub_date'];<br /></code></pre><br /><br /><p>In this case it always returns NULL..</p><br /><br /><p>What I am doing wrong?</p><br /><br /><p>How to assign more values to the array and getting them back when I need, knowing that the things I get should contain more values. It's like an array of an array...</p><br /><br /><p>I am a little confused..</p><br /><br /><p>I like the solution with objects, but if there is any other way, then better.</p><br /><br /><p>This is an example of what I get from the array $post:</p><br /><br /><pre><code>array(5) { [0]=&gt; array(5) { ["author_id"]=&gt; string(10) "1319929690" ["orginal_id"]=&gt; string(24) "1319929690_2736172406396" ["post_url"]=&gt; string(77) "https://www.facebook.com/permalink.php?story_fbid=2736172406396&amp;id=1319929690" ["descritpion"]=&gt; string(773) "It was only a matter of time. # How do they serve alcoholic drinks on Italian cruise ships? - On the rocks # What vegetables do you get with dinner on Italian cruise ships? - Leeks # What's the fastest way to get off an Italian cruise ship? - Follow the captain # When the captain of the ill fated Costa Concordia was asked if he knew where he was going he replied "off course." # So the captain of the Costa Concordia will soon be in the dock. That's more than can be said for his ship. # The Costa Concordia is probably the most expensive thing to go down in Italy since Berlusconi's last hooker. # What's the difference between the Italian economy and the stricken cruise liner Costa Concordia? Nothing - The bottoms dropped out of both." ["pub_date"]=&gt; string(24) "2012-02-04T14:36:54+0000" } [1]=&gt; array(5) { ["author_id"]=&gt; string(10) "1721122272" ["orginal_id"]=&gt; string(24) "1721122272_1862454417365" ["post_url"]=&gt; string(77) "https://www.facebook.com/permalink.php?story_fbid=1862454417365&amp;id=1721122272" ["descritpion"]=&gt; string(1968) "ThÃ¡ch thÃ ng nÃ o quÃ¡nh tao 1. Má»¸: â€œTao muá»‘n Ä‘Ã¡nh tháº±ng nÃ o, lÃ  tao Ä‘Ã¡nh tháº±ng Ä‘Ã³. NgoÃ i ra, tao bao tiá»n sÃºng!â€ 2. NATO: â€œMá»¹ Ä‘Ã¡nh tháº±ng nÃ o, tao Ä‘Ã¡nh tháº±ng Ä‘Ã³!â€. 3. NGA: â€œTháº±ng nÃ o báº­t tao, tao cáº¯t dáº§u lá»­a!â€. 4. ISRAEL: â€œtháº±ng nÃ o ngáº¥m ngáº§m muá»‘n Ä‘Ã¡nh tao, tao Ä‘Ã¡nh tháº±ng Ä‘Ã³!â€. 5. NHáº¬T: â€œtháº±ng nÃ o Ä‘Ã¡nh tao, tao sáº½ báº£o Má»¹ Ä‘Ã¡nh tháº±ng Ä‘Ã³. Náº¿u chÃºng mÃ y khÃ´ng ngá»«ng táº¥n cÃ´ng, tao cho Maria Ozawa nghá»‰ viá»‡c!â€. 6. TRUNG QUá»C: â€œTháº±ng nÃ o gáº§n tao, tao Ä‘Ã¡nh tháº±ng Ä‘Ã³!â€. 7. ÄÃ€I LOAN: â€œTháº±ng nÃ o Ä‘Ã²i Ä‘Ã¡nh tao, tao báº£o bÃ¡o chÃ­ chá»­i tháº±ng Ä‘Ã³!â€. 8. NAM HÃ€N: â€œTháº±ng nÃ o Ä‘á»‹nh Ä‘Ã¡nh tao, tao táº­p tráº­n vá»›i tháº±ng Má»¹!â€. 9. Báº®C HÃ€N: â€œTháº±ng nÃ o lÃ m tao bá»±c, tao sáº½ Ä‘Ã¡nh tháº±ng Nam HÃ n!â€. 10. Berlusconi (ITALIA): â€œTháº±ng nÃ o oÃ¡nh tao, taoâ€¦ ngá»§ vá»›i vá»£ tháº±ng Ä‘Ã³!â€. 11. SINGAPORE : â€œTháº±ng nÃ o Ä‘Ã¡nh tao?!Cháº¯c Ä‘áº¿k tháº±ng nÃ o ráº£nh mÃ  Ä‘i Ä‘Ã¡nh tao!â€. 12. IRAQ : â€œTháº±ng nÃ o Ä‘Ã¡nh tao thÃ¬ cá»© Ä‘Ã¡nh cho Ä‘Ã£, chá»«ng nÃ o má»‡t thÃ¬ tá»± Ä‘á»™ng vá»!â€. 13. ARAP SAUDI : â€œTháº±ng nÃ o Ä‘Ã¡nh tao, tao mua tháº±ng Ä‘Ã³!â€ 14. Billaden: â€œTháº±ng nÃ o Ä‘Ã¡nh tao, tao khá»§ng bá»‘ tháº±ng Má»¹!â€. 15. LiÃªn Hiá»‡p Quá»‘c: â€œTao dÃ¡n cÃ¡i mÃ¡câ€¦ vÃ¹ng cáº¥m bay lÃªn tháº±ng nÃ o, chÃºng mÃ y Ãºp sá»t tháº±ng Ä‘áº¥y cho tao!â€. 16. CUBA : â€œTháº±ng nÃ o oÃ¡nh tao, tao cho Viá»‡t Nam má»™t mÃ¬nh canh giá»¯ tháº¿ giá»›i!â€. 17. VIá»†T NAM: â€œChá»- nÃ o cÃ³ oÃ¡nh nhau, tao bÃ y tá» quan ngáº¡i sÃ¢u sáº¯c. CÃ²n tháº±ng nÃ o oÃ¡nh tao, tao tuyÃªn bá»‘ chá»§ quyá»n, tao cáº¯t Ä‘iá»‡n luÃ¢n phiÃªn, sau Ä‘Ã³ taoâ€¦ cá»±c lá»±c lÃªn Ã¡n!â€. 18. THá»¤Y SÄ¨ : Tháº±ng nÃ o Ä‘Ã¡nh tao, Tao khÃ³a tÃ i khoáº£n tiá»n quá»‘c gia tháº±ng Ä‘Ã³. 19. PHILIPIN : â€ Tháº±ng nÃ o Ä‘Ã¡nh tao, muá»‘n há»©ng bÃ£o qua mÃ  Ä‘Ã¡nh. =]]" ["pub_date"]=&gt; string(24) "2012-02-04T13:50:47+0000" } [2]=&gt; array(5) { ["author_id"]=&gt; string(9) "594958865" ["orginal_id"]=&gt; string(27) "594958865_10150583915793866" ["post_url"]=&gt; string(80) "https://www.facebook.com/permalink.php?story_fbid=10150583915793866&amp;id=594958865" ["descritpion"]=&gt; string(717) "# How do they serve alcoholic drinks on Italian cruise ships? - On the rocks # What vegetables do you get with dinner on Italian cruise ships? - Leeks # What's the fastest way to get off an Italian cruise ship? - Follow the captain # When the captain of the ill fated Costa Concordia was asked if he knew where he was going he replied "off course." # So the captain of the Costa Concordia will soon be in the dock. That's more than can be said for his ship. # The Costa Concordia is probably the most expensive thing to go down in Italy since Berlusconi's last hooker. # What's the difference between the Italian economy and the stricken cruise liner Costa Concordia? Nothing - The bottoms dropped out of both." ["pub_date"]=&gt; string(24) "2012-02-04T13:15:45+0000" } [3]=&gt; array(5) { ["author_id"]=&gt; string(10) "1561522855" ["orginal_id"]=&gt; string(24) "1561522855_2516825610916" ["post_url"]=&gt; string(77) "https://www.facebook.com/permalink.php?story_fbid=2516825610916&amp;id=1561522855" ["descritpion"]=&gt; string(410) "Monti "frainteso" sulla monotonia del posto fisso??? Come Berlusconi che smentiva le proprie dichiarazioni mezzora dopo averle fatte??? Ma fatemi il piacere!!! La cosa che piÃ¹ mi fa specie Ã© assistere all'atteggiamento di tanti antiberlusconiani di maniera che ieri si stracciavano le vesti per ogni cazzata che proveniva da Arcore e che oggi sono pronti a digerire politiche ed esternazioni anche peggiori!!" ["pub_date"]=&gt; string(24) "2012-02-04T12:46:50+0000" } [4]=&gt; array(5) { ["author_id"]=&gt; string(9) "749211731" ["orginal_id"]=&gt; string(27) "749211731_10150528401901732" ["post_url"]=&gt; string(80) "https://www.facebook.com/permalink.php?story_fbid=10150528401901732&amp;id=749211731" ["descritpion"]=&gt; string(265) "B. al Financial Times: "Mi farÃ² da parte dalla politica attiva e non ho nessuna intenzione di candidarmi ancora a primo ministro". Bossi: "Se Berlusconi si ritira Ã¨ risolto il problema". La solida alleanza parlamentare che ha governato l'Italia in questi 20 anni." ["pub_date"]=&gt; string(24) "2012-02-04T11:57:05+0000" } } <br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/735997" rel="nofollow">DiegoP.</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[WSO2 WSF error / rampart_context_create]]></title>
<link>http://www.globberstack.com/Questions/wso2-wsf-error-rampart-context-create-1/</link>
<comments>http://www.globberstack.com/Questions/wso2-wsf-error-rampart-context-create-1/</comments>
<pubDate>Sat, 04 Feb 2012 09:44:27 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/wso2-wsf-error-rampart-context-create-1/</guid>
<description><![CDATA[<br />            <p>After installing wsf/php 2.1 using</p><br /><br /><p>All Examples work except for security examples... and I get this error logged in apache error.log:</p><br /><br /><blockquote><br />  <p>/usr/lib/php5/xxx/wsf.so: undefined symbol: rampart_context_create</p><br /></blockquote><br /><br /><p>I am running Ubuntu 11.10 and PHP 5.3.6-13ubuntu3.3 with Suhosin-Patch (cli) (built: Dec 13 2011 18:37:10)</p><br /><br /><p>What could be the error?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1188417" rel="nofollow">user1188417</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[get the specified outpot using php 2d array]]></title>
<link>http://www.globberstack.com/Questions/get-the-specified-outpot-using-php-2d-array-1/</link>
<comments>http://www.globberstack.com/Questions/get-the-specified-outpot-using-php-2d-array-1/</comments>
<pubDate>Sat, 04 Feb 2012 09:43:27 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/get-the-specified-outpot-using-php-2d-array-1/</guid>
<description><![CDATA[<br />            <p>I have got a 2d array called $myarray, and when I using var_dump($myarray), it gives me the following:</p><br /><br /><pre><code>  array(4) { [0]=&gt; array(2) { [0]=&gt; string(3) "EUR" [1]=&gt; string(9) "43,543.23" } [1]=&gt; array(2) { [0]=&gt; string(3) "USD" [1]=&gt; string(9) "13,432.34" } [2]=&gt; array(2) { [0]=&gt; string(3) "GBP" [1]=&gt; string(8) "3,432.21" } [3]=&gt; array(2) { [0]=&gt; string(3) "CAD" [1]=&gt; string(8) "2,321.34" } } <br /></code></pre><br /><br /><p>But I want the output to be the follwing format:</p><br /><br /><pre><code>Totals<br />GBP 3,432.21<br />USD 13,432.34<br />EUR 43,543.23<br />CAD 2,321.34<br /></code></pre><br /><br /><p>I assume that I need to sort the array to be:</p><br /><br /><pre><code>GBP 3,432.21<br />USD 13,432.34<br />EUR 43,543.23<br />CAD 2,321.34<br /></code></pre><br /><br /><p>and add "Totals", "" into the array, I might be wrong, soanybody could help me with that, any help will be greatly appreciated!</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/971933" rel="nofollow">smith</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Generate Distinct Combinations PHP]]></title>
<link>http://www.globberstack.com/Questions/generate-distinct-combinations-php-1/</link>
<comments>http://www.globberstack.com/Questions/generate-distinct-combinations-php-1/</comments>
<pubDate>Sat, 04 Feb 2012 09:42:43 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/generate-distinct-combinations-php-1/</guid>
<description><![CDATA[<br />            <p>I need an efficient algorithm to generate distinct combinations(not allowed to repeat). Each combination has 5 distint numbers(different numbers) that ranges between 1 and 99. The result must be stored in an array. If possible I would like the numbers and range allowed to be customized. The order of number doesn't matter(01 02 03 = 03 01 02)</p><br /><br /><pre><code> Ex.: <br /> 01 02 03 04 05<br /> 02 03 04 05 06<br /> ...<br /></code></pre><br /><br /><p>Does anyone could help me to build it? I would like to pick up some random combinations from the array. Nowdays I am generating random combinations using mt_rand but It takes too much time, SO SLOW! I believe happens to repeat so often then takes time to generate new one and new one...</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/531466" rel="nofollow">Rafael</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

</channel>
</rss>

