<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:re="http://purl.org/atompub/rank/1.0">
    <title type="text">Recent Questions - Stack Overflow</title>
    <link rel="self" href="http://stackoverflow.com/feeds" type="application/atom+xml" />
    <link rel="alternate" href="http://stackoverflow.com/questions" type="text/html" />
    <subtitle>most recent 30 from stackoverflow.com</subtitle>
    <updated>2012-02-08T13:45:53Z</updated>
    <id>http://stackoverflow.com/feeds</id>
    <creativeCommons:license>http://www.creativecommons.org/licenses/by-sa/3.0/rdf</creativeCommons:license> 
    <entry>
        <id>http://stackoverflow.com/q/9194457</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">How do I remove multiple href links via the ID with jquery?</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="jquery"/><category scheme="http://stackoverflow.com/feeds/tags" term="css"/>
        <author>
            <name>Paul</name>
            <uri>http://stackoverflow.com/users/849065</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194457/how-do-i-remove-multiple-href-links-via-the-id-with-jquery" />
        <published>2012-02-08T13:42:37Z</published>
        <updated>2012-02-08T13:45:29Z</updated>
        <summary type="html">
            &lt;p&gt;I&#39;m having issues removing several of my href links that all have the same ID.  Here is my code snippet:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    $(&#39;.delblk&#39;).click(function(e) {
        e.preventDefault();

        var id = $(this).attr(&#39;id&#39;).substr(7);

        $.getJSON(&quot;../ajax_blocked.php?op=delete&amp;amp;id=&quot;+id, function(data) {
        if (data) {

            $(&quot;#delblk_&quot;+id).each(function() {
                $(this).remove();
            });
        }
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;My HTML looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;a href=&quot;sent.php&quot; id=&quot;delblk_7&quot; class=&quot;delblk&quot; &amp;gt;&amp;lt;span class=&quot;label label-important&quot;&amp;gt;Unblock&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;
&amp;lt;a href=&quot;sent.php&quot; id=&quot;delblk_7&quot; class=&quot;delblk&quot; &amp;gt;&amp;lt;span class=&quot;label label-important&quot;&amp;gt;Unblock&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;
&amp;lt;a href=&quot;sent.php&quot; id=&quot;delblk_8&quot; class=&quot;delblk&quot; &amp;gt;&amp;lt;span class=&quot;label label-important&quot;&amp;gt;Unblock&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It&#39;s only removing the first href link and not both of them.  What am I missing?&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194495</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">C# - Type exists in 2 assemblies</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="c#"/>
        <author>
            <name>Kou S Hal</name>
            <uri>http://stackoverflow.com/users/1197167</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194495/c-sharp-type-exists-in-2-assemblies" />
        <published>2012-02-08T13:44:49Z</published>
        <updated>2012-02-08T13:44:49Z</updated>
        <summary type="html">
            &lt;p&gt;I have created 2 .NET Interop assemblies from 2 different 3rd party COM DLLs.
Both of the COM DLLs contained a type named COMMONTYPE.
Therefore, COMMONTYPE is now exposed through the 2 Interop assemblies as well.
I have a 3rd project that needs to use these 2 Interop assemblies.
And I get the infamous compile time error,
&quot;The type  exists in both  and &quot;&lt;/p&gt;

&lt;p&gt;Since the COM DLLs are provided by a 3rd party vendor, I have no access to the source code.&lt;/p&gt;

&lt;p&gt;And I&#39;m writing a C# Console application which means I have no web.config file where I could add the debug=false workaround.&lt;/p&gt;

&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9180502</id>
        <re:rank scheme="http://stackoverflow.com">2</re:rank>
        <title type="text">Why does my SQL data cause my chart&#39;s Y axis to jump to infinity?</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="php"/><category scheme="http://stackoverflow.com/feeds/tags" term="drupal"/><category scheme="http://stackoverflow.com/feeds/tags" term="drupal-modules"/>
        <author>
            <name>akshaynhegde</name>
            <uri>http://stackoverflow.com/users/1190202</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9180502/why-does-my-sql-data-cause-my-charts-y-axis-to-jump-to-infinity" />
        <published>2012-02-07T17:02:53Z</published>
        <updated>2012-02-08T13:44:48Z</updated>
        <summary type="html">
            &lt;p&gt;I have been trying to build a graph using open Flash Chart 2 in Drupal (Well, the problem isn&#39;t related to Drupal or the graphs and  chart module)&lt;/p&gt;

&lt;p&gt;For the graph I am fetching the data from a MySQL database. Below is the function which gets the data and generates the graph:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function my_module_charts_graphs_test() {

 global $user;
$uname = $user-&amp;gt;name;
$sql = &quot;Select total_calorie from health_calorie_consumed where name = &#39;%s&#39;&quot;;
$result = db_query($sql,$uname);


  while($row = db_fetch_array($result))
{

    $data[] = $row[total_calorie];

}

$canvas = charts_graphs_get_graph(&#39;open-flash&#39;);

  $canvas-&amp;gt;title = &quot;OpenFlashCharts Chart&quot;;
  $canvas-&amp;gt;type = &quot;bar_3d&quot;;
  $canvas-&amp;gt;y_legend = &quot;Y Legend&quot;;
  $canvas-&amp;gt;colour = &#39;#808000&#39;;
  $canvas-&amp;gt;width = 700;
  $canvas-&amp;gt;height = 300;
  $canvas-&amp;gt;y_max=1000;
  $canvas-&amp;gt;y_min=0;
  $canvas-&amp;gt;y_step=100;
  $canvas-&amp;gt;series = array(
    &#39;Some Value&#39; =&amp;gt; array(923,623,73,92,5,722,643,156,345),
    //&#39;Page Views&#39; =&amp;gt; array_values($data),
  );
  $canvas-&amp;gt;x_labels = array(&#39;one&#39;, &#39;two&#39;, &#39;three&#39;, &#39;four&#39;, &#39;five&#39;, &#39;six&#39;, &#39;seven&#39;, &#39;eight&#39;, &#39;nine&#39;);

  // $canvas-&amp;gt;x_labels = array_values($data);

  $out = $canvas-&amp;gt;get_chart();

  return $out;


} 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When I run the code, I get the below graph:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oi43.tinypic.com/2hcfgqp.jpg&quot; alt=&quot;preview-1&quot;&gt;&lt;/p&gt;

&lt;p&gt;So, it works perfectly with a locally declared array. But I need to use the array from SQL. Hence I uncomment and change &lt;code&gt;$canvas-&amp;gt;c_labels&lt;/code&gt; and &lt;code&gt;$canvas-&amp;gt;series&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; $canvas-&amp;gt;x_labels = array_values($data); //$data is array from sql query

&#39;Page Views&#39; =&amp;gt; array_values($data)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now, to my surprise, I get the below graph:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oi41.tinypic.com/spb42g.jpg&quot; alt=&quot;preview-2&quot;&gt;&lt;/p&gt;

&lt;p&gt;As we can see, the x_axis values are right as per the query but y_axis says the same values as infinity. Why does it do this?&lt;/p&gt;

&lt;p&gt;There is another face to this strange problem. Initially I thought that this approach may not work with &lt;code&gt;$canvas-&amp;gt;series&lt;/code&gt;, but I tried the below code and it worked perfectly:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$array = array(0,0,117,207,130,260,207); //these values are that are fetched from sql
$canvas-&amp;gt;series = array(
   &#39;some values&#39;=&amp;gt;array_values($array),
   );
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So this &quot;infinity&quot; problem only appears for arrays fetched from SQL queries and only for the Y axis.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print_r($data)&lt;/code&gt; of my SQL is as follows:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Array ( [0] =&amp;gt; 0 [1] =&amp;gt; 0 [2] =&amp;gt; 117 [3] =&amp;gt; 207 [4] =&amp;gt; 130 [5] =&amp;gt; 260 [6] =&amp;gt; 207 ) 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Below are some other combinations I tried for $canvas-&gt;series and failed...&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$test = implode(&quot;,&quot;,$data); // $data is the array fetched from sql
$abcd = &quot;array(&quot;.$test.&quot;)&quot;; // array(0,0,117,207,130,260,207)

$canvas-&amp;gt;series=&amp;gt;array(
      &#39;some value&#39;=&amp;gt;print($abcd), //i tried to print those values in standard format..:p
      );
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;pre&gt;&lt;code&gt;&#39;some values&#39;=&amp;gt;$abcd, // doesn&#39;t work..!
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;pre&gt;&lt;code&gt;&#39;some values&#39;=&amp;gt;$data, // doesn&#39;t work.!
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Thus I tried everything I can think of with no luck.&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194320</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Spinner onItemSelected a Action should trigger in for getting data</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="android"/>
        <author>
            <name>Mukunda</name>
            <uri>http://stackoverflow.com/users/791169</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194320/spinner-onitemselected-a-action-should-trigger-in-for-getting-data" />
        <published>2012-02-08T13:33:06Z</published>
        <updated>2012-02-08T13:44:47Z</updated>
        <summary type="html">
            &lt;p&gt;I am trying this code &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;findUsStateOrMileSpinnerState.setOnItemSelectedListener(
  new AdapterView.OnItemSelectedListener() {
    public void onItemSelected(AdapterView&amp;lt;?&amp;gt; adapterView, View view, 
         int i, long l) 
    { 
       spinnerState = findUsStateOrMileSpinnerState.getSelectedItem().toString(); 
       if(spinnerState.equalsIgnoreCase(&quot;State&quot;)){
           getDetailsState();
       }
       if(spinnerState == &quot;Miles&quot;){
            getDetailsMiles();              
       }    
    } 

    public void onNothingSelected(AdapterView&amp;lt;?&amp;gt; adapterView) {
       return;
    } 
  }
); 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;On some selected item it should call another listener.
Spinner is having Miles and State.
But it is not going through the if statement, am I doing something wrong.
Looking forward to your reply.
thanks.&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194434</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">copy allocated char array to &quot;normal&quot; char array</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="c++"/><category scheme="http://stackoverflow.com/feeds/tags" term="c"/><category scheme="http://stackoverflow.com/feeds/tags" term="char"/><category scheme="http://stackoverflow.com/feeds/tags" term="malloc"/><category scheme="http://stackoverflow.com/feeds/tags" term="strcpy"/>
        <author>
            <name>Jake Badlands</name>
            <uri>http://stackoverflow.com/users/1188304</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194434/copy-allocated-char-array-to-normal-char-array" />
        <published>2012-02-08T13:40:53Z</published>
        <updated>2012-02-08T13:45:24Z</updated>
        <summary type="html">
            &lt;p&gt;Please, tell me, what is the correct way of copying allocated char array to &quot;normal&quot; char array?
I have attempted to do the following, but it fails :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;char * buf = (char *) malloc (BUFSIZ * sizeof(char));
// filling up the allocated array with stuff...
char temp[BUFSIZ];
strcpy(temp, buf); // strcpy doesn&#39;t work
&lt;/code&gt;&lt;/pre&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9193312</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Encrypt mailto email addresses with inline JavaScript</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="javascript"/><category scheme="http://stackoverflow.com/feeds/tags" term="email"/><category scheme="http://stackoverflow.com/feeds/tags" term="encryption"/><category scheme="http://stackoverflow.com/feeds/tags" term="protect"/>
        <author>
            <name>testing</name>
            <uri>http://stackoverflow.com/users/426227</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9193312/encrypt-mailto-email-addresses-with-inline-javascript" />
        <published>2012-02-08T12:28:26Z</published>
        <updated>2012-02-08T13:44:45Z</updated>
        <summary type="html">
            &lt;p&gt;I have the following JS Code&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;script type=&#39;text/javascript&#39;&amp;gt;
    var v2=&quot;xxxxx&quot;;
    var v7=unescape(&quot;%2%3432jklsjdkls%&quot;);
    var v5=v2.length;
    var v1=&quot;&quot;;
    for(var v4=0;v4&amp;lt;v5;v4++){
        v1+=String.fromCharCode(v2.charCodeAt(v4)^v7.charCodeAt(v4));
    }
    document.write(&#39;&amp;lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;window.location=\&#39;mail\u0074o\u003a&#39;+v1+&#39;?subject=&#39;+&#39;\&#39;&quot;&amp;gt;&#39;+&#39;test(at)test(dot)com&amp;lt;\/a&amp;gt;&#39;);
 &amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This JS Code is on one line and I have no other possibility than this. Now I have to change the email address, but I need the &lt;code&gt;v2&lt;/code&gt; and &lt;code&gt;v7&lt;/code&gt; which I can&#39;t create.&lt;/p&gt;

&lt;p&gt;Do you know where this snippet comes from? Do you know another algorithm which is secure (not only taking the ASCI values)? Here the ASCII Codes, a XOR catenation and the encrypted value + key are used.&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/8880649</id>
        <re:rank scheme="http://stackoverflow.com">1</re:rank>
        <title type="text">Android Emulator doesnt load the App(Crash Report)</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="android"/><category scheme="http://stackoverflow.com/feeds/tags" term="eclipse"/><category scheme="http://stackoverflow.com/feeds/tags" term="android-emulator"/>
        <author>
            <name>Rosalie</name>
            <uri>http://stackoverflow.com/users/749849</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/8880649/android-emulator-doesnt-load-the-appcrash-report" />
        <published>2012-01-16T13:26:18Z</published>
        <updated>2012-02-08T13:44:45Z</updated>
        <summary type="html">
            &lt;p&gt;I am having a problem in running my app in Emulator. There are no errors or warnings in the code, its running perfect in device, but when it comes to emulator, it always crashes and the error message would be like this&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[2012-01-16 16:13:55 - MyApp] Failed to install MyApp.apk on device &#39;emulator-5554!

[2012-01-16 16:13:55 - MyApp] (null)

[2012-01-16 16:13:55 - MyApp] Launch canceled!
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I have tried the following things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Run configurations &gt; Target &gt; Wipe user data &gt; Run&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Uninstalling the app and run it again&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Restarting the emulator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;adb kill-server &amp;amp;&amp;amp; adb start-server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creating a new Emulator and running the app in it&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Restarting ADB&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Restarting Eclipse&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Starting the Eclipse after the emulator is launched completely&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increasing the ADB connection time-out to 1000&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Restarting the System&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deleted the emulators and created new emulators and run in it after they are completely loaded&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I don&#39;t know what else should I do. Sometimes if I run in a new Emulator the app runs for the first time and if I run it again after sometime, its the same crash report. I am not able to understand what is the problem. &lt;/p&gt;

&lt;p&gt;Can anyone please suggest me what should I do now and where is the problem? 
The Emulator used to work well before. This problem started a few days back.&lt;/p&gt;

&lt;p&gt;Any help will be appreciated. Thanks All.&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194489</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Doubles with constraints in Java?</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="java"/>
        <author>
            <name>Salim Fadhley</name>
            <uri>http://stackoverflow.com/users/46411</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194489/doubles-with-constraints-in-java" />
        <published>2012-02-08T13:44:42Z</published>
        <updated>2012-02-08T13:44:42Z</updated>
        <summary type="html">
            &lt;p&gt;I am porting a legacy Python system to Java. I&#39;m a python developer primarily so this question concerns how I might take an unsatisfactory pattern in the original Python system but do it better in my Java version. &lt;/p&gt;

&lt;p&gt;A system I&#39;m working on deals with prices of products. All products have prices &gt; 0.0.&lt;/p&gt;

&lt;p&gt;In the orginal system all prices are represented as Python float objects (roughly like a Java Double). Functions which operate on these prices typically begin with a bunch of asserts to check that the range of the prices are sensible. Since there are a lot of functions there are a lot of assertions which become very repetitive after a while. &lt;/p&gt;

&lt;p&gt;These assertions are better than nothing but it would be far better to throw an error the instant that something tried to create a negative price, since that&#39;s where the fault lies.&lt;/p&gt;

&lt;p&gt;It occurred to me that I might do better in my re-implementation by inventing a new type of numberish thing which behaves exactly like a Double in all ways except that it cannot be constructed with a negative value. If I had such an object then I could rely on Java&#39;s type system and not need to write so many asserts.&lt;/p&gt;

&lt;p&gt;Other than that (to begin with) it will obey all the normal rules of arethmatic - it will be a subclass of Double. &lt;/p&gt;

&lt;p&gt;Later on I might extend this class by adding features that embrace more features of real-world money, e.g. preventing fractions of pennies. That&#39;s not actually needed in my initial version, but I&#39;d like any pattern I adopt to accomodate this sort of development over the next few months.&lt;/p&gt;

&lt;p&gt;Is this kind of pattern considered acceptable to a Java developer? Is there a better way to preserve the flexibility of having number-like objects but constraints on their possible values?&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194217</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">How to set z-index on tinyMCE toolbar?</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="jquery"/><category scheme="http://stackoverflow.com/feeds/tags" term="css"/><category scheme="http://stackoverflow.com/feeds/tags" term="tinymce"/>
        <author>
            <name>Awan</name>
            <uri>http://stackoverflow.com/users/300118</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194217/how-to-set-z-index-on-tinymce-toolbar" />
        <published>2012-02-08T13:27:06Z</published>
        <updated>2012-02-08T13:44:41Z</updated>
        <summary type="html">
            &lt;p&gt;I am using tinyMCE editor plugin. It converts texareas into iframes and a toolbar appears at top of the text content. It is working perfectly. &lt;/p&gt;

&lt;p&gt;Sometimes there are some videos above the content. So when I click textarea, the toolbar appears but video player above the content hides it behind itself. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is there any way to change the z-index of the toolbar ? (Preferable)
Or should I change the location of toolbar ???&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is my code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;tinyMCE.init({
        mode : &quot;textareas&quot;,
        editor_selector : &quot;combo123&quot;,
        theme : &quot;advanced&quot;,
        plugins : &quot;save, paste, autoresize, asciimath, asciisvg&quot;,
        theme_advanced_styles: &quot;Foo=foo, Bar=bar&quot;,
        content_css : &quot;/css/tiny_mce.css&quot;
  });
&lt;/code&gt;&lt;/pre&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/5552379</id>
        <re:rank scheme="http://stackoverflow.com">3</re:rank>
        <title type="text">Prevent Dozer from triggering Hibernate lazy loading</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="java"/><category scheme="http://stackoverflow.com/feeds/tags" term="hibernate"/><category scheme="http://stackoverflow.com/feeds/tags" term="spring"/><category scheme="http://stackoverflow.com/feeds/tags" term="dozer"/><category scheme="http://stackoverflow.com/feeds/tags" term="spring-transactions"/>
        <author>
            <name>Tristan</name>
            <uri>http://stackoverflow.com/users/668455</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/5552379/prevent-dozer-from-triggering-hibernate-lazy-loading" />
        <published>2011-04-05T13:11:39Z</published>
        <updated>2012-02-08T13:44:41Z</updated>
        <summary type="html">
            &lt;p&gt;I am using Spring transactions so the transaction is still active when POJO to DTO conversion occurs.&lt;/p&gt;

&lt;p&gt;I would like to prevent Dozer from triggering lazy loading, so that hidden sql queries never occur : all fetching has to be done explicitly via HQL (to get the best control on performances).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Is it a good practice (I can&#39;t find it documented anywhere) ?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to do it safely ?&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I tried this before DTO conversion :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;PlatformTransactionManager tm = (PlatformTransactionManager) SingletonFactoryProvider.getSingletonFactory().getSingleton(&quot;transactionManager&quot;);
tm.commit(tm.getTransaction(new DefaultTransactionDefinition()));
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I don&#39;t know what happens to the transaction, but the Hibernate session doesn&#39;t get closed, and the lazy loading still occurs.&lt;/p&gt;

&lt;p&gt;I tried this :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;SessionFactory sf = (SessionFactory) SingletonFactoryProvider.getSingletonFactory().getSingleton(&quot;sessionFactory&quot;);
sf.getCurrentSession().clear();
sf.getCurrentSession().close();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And it prevents lazy loading, but is it a good practice to manipulate session directly in the application layer (which is called &quot;facade&quot; in my project) ? Which negative side effects should I fear ? (I&#39;ve already seen that tests involving POJO -&gt; DTO conversions could no more be launched through AbstractTransactionnalDatasource Spring test classes, because this classes try to trigger a rollback on a transaction which is no more linked to an active session).&lt;/p&gt;

&lt;p&gt;I&#39;ve also tried to set propagation to NOT_SUPPORTED or REQUIRES_NEW, but it reuse the current Hibernate session, and doesn&#39;t prevent lazy loading.&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9193896</id>
        <re:rank scheme="http://stackoverflow.com">-2</re:rank>
        <title type="text">prepare DateTime from a formatted timespan string?</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="c#"/><category scheme="http://stackoverflow.com/feeds/tags" term="datetime"/>
        <author>
            <name>user852194</name>
            <uri>http://stackoverflow.com/users/852194</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9193896/prepare-datetime-from-a-formatted-timespan-string" />
        <published>2012-02-08T13:06:57Z</published>
        <updated>2012-02-08T13:44:40Z</updated>
        <summary type="html">
            &lt;p&gt;I have a windows application which interact with an automation system which send exact start time of EPGs (automatic-recording event).&lt;/p&gt;

&lt;p&gt;Example of received timespan: &lt;code&gt;16:30:59&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The problem is that this value can be in the past or in the future.
Example:
Now : &lt;code&gt;2012-03-08 12:58:44&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I can receive one of following values : &lt;code&gt;12:59:01&lt;/code&gt; or &lt;code&gt;12:58:41&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;here is the code which help me to get the &lt;code&gt;DateTime&lt;/code&gt; from this timespan string:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;DateTime ExactStartDateTime = DateTime.Now.ToUniversalTime().Date;
ExactStartDateTime = ExactStartDateTime +  (formatted timespan string);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;this code works fine, except in this case:&lt;/p&gt;

&lt;p&gt;trigger received &lt;code&gt;DateTime&lt;/code&gt;: &lt;code&gt;2012-01-31 23:58:23&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;formatted timespan : &lt;code&gt;00:03:53&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If we test code with the case above, I get &lt;code&gt;ExactStartDateTime = 2012-01-31 00:03:53&lt;/code&gt;, which is the wrong value (the right value should be &lt;code&gt;2012-02-01 00:03:53&lt;/code&gt;) day after.&lt;/p&gt;

&lt;p&gt;I know this scenario is quite strange since there is no logic, but the provider can&#39;t  provide me the date.&lt;/p&gt;

&lt;p&gt;I hope someone of you had face same issue before.&lt;/p&gt;

&lt;p&gt;I am getting stuck with this, I want to fie it with rotten logic as (if diff timespan &gt;= 23 hours then increment &lt;code&gt;DateTime&lt;/code&gt; by one ...) &lt;/p&gt;

&lt;p&gt;More example :
1- &lt;/p&gt;

&lt;p&gt;Input :
- Current Time                : 2012-03-08 13:27:00
- Received TimeSpan as string :            13:28:30&lt;/p&gt;

&lt;p&gt;Output
- The program will start at   :2012-03-08 13:28:30&lt;/p&gt;

&lt;p&gt;2- &lt;/p&gt;

&lt;p&gt;Input :
- Current Time                : 2012-03-08 23:58:19
- Received TimeSpan as string :            00:02:15&lt;/p&gt;

&lt;p&gt;Output
- The program will start at   :2012-03-09 00:02:15 (day after)&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9190126</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Find list of special folders in Windows using Qt</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="qt"/><category scheme="http://stackoverflow.com/feeds/tags" term="windows-7"/><category scheme="http://stackoverflow.com/feeds/tags" term="operating-system"/>
        <author>
            <name>Dilshad</name>
            <uri>http://stackoverflow.com/users/383612</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9190126/find-list-of-special-folders-in-windows-using-qt" />
        <published>2012-02-08T08:51:28Z</published>
        <updated>2012-02-08T13:44:34Z</updated>
        <summary type="html">
            &lt;p&gt;Is it possible to get a list of the Special Folders in Windows 7 using Qt 4.7.4
I need to know in which directory the Operating System is installed and which folders I have write- access to.
Special Folders will include folders like &#39;Desktop&#39;, &#39;Program Data&#39;, etc....
These folders may or may not be hidden.&lt;/p&gt;

&lt;p&gt;I appreciate your time and response.
Thank you in advance. &lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9193948</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">XML-RPC message format trouble</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="python"/><category scheme="http://stackoverflow.com/feeds/tags" term="web-services"/><category scheme="http://stackoverflow.com/feeds/tags" term="xml-rpc"/>
        <author>
            <name>DonCallisto</name>
            <uri>http://stackoverflow.com/users/814253</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9193948/xml-rpc-message-format-trouble" />
        <published>2012-02-08T13:10:22Z</published>
        <updated>2012-02-08T13:44:29Z</updated>
        <summary type="html">
            &lt;p&gt;I have a WS (ZOPE/PLONE) that accept some XMLRPC calls.&lt;/p&gt;

&lt;p&gt;So, I write a python snippet of code for do a call to WS and do something.&lt;/p&gt;

&lt;p&gt;I follow messagge format that I found &lt;a href=&quot;http://xmlrpc.scripting.com/spec.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, and that&#39;s my snippet of code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;import httplib

def queryInventory():
    try:
        xmlrpc_envelope = &#39;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&#39;\
                        &#39;&amp;lt;methodCall&amp;gt;&#39;\
                        &#39;&amp;lt;methodName&amp;gt;easyram&amp;lt;/methodName&amp;gt;&#39;\
                          &#39;&amp;lt;params&amp;gt;&#39;\
                            &#39;&amp;lt;param&amp;gt;&#39;\
                              &#39;&amp;lt;value&amp;gt;%s&amp;lt;/value&amp;gt;&#39;\
                            &#39;&amp;lt;/param&amp;gt;&#39;\
                          &#39;&amp;lt;/params&amp;gt;&#39;\
                        &#39;&amp;lt;/methodCall&amp;gt;&#39;        

        params = &#39;&amp;lt;EasyRAM&amp;gt;&#39;\
             &#39;&amp;lt;authentication&amp;gt;&amp;lt;user&amp;gt;EasyRAM&amp;lt;/user&amp;gt;&amp;lt;pwd&amp;gt;EasyRAM&amp;lt;/pwd&amp;gt;&amp;lt;hotel&amp;gt;52&amp;lt;/hotel&amp;gt;&amp;lt;/authentication&amp;gt;&#39;\
             &#39;&amp;lt;operation type=&quot;QueryInventory&quot; rate=&quot;master&quot;&amp;gt;&amp;lt;date from=&quot;2012-03-10&quot; to=&quot;2012-03-10&quot; /&amp;gt;&amp;lt;date from=&quot;2012-03-22&quot; to=&quot;2012-03-22&quot; /&amp;gt;&amp;lt;/operation&amp;gt;&#39;\
             &#39;&amp;lt;/EasyRAM&amp;gt;&#39;

        data = xmlrpc_envelope % params
        print data
        headers = {&quot;Content-type&quot;: &quot;text/xml&quot;}
        conn = httplib.HTTPSConnection(&#39;myHost&#39;)
        aa = &#39;/ws/xmlrpc/public/EasyRAM&#39;
        conn.request(&quot;POST&quot;, aa, data, headers)
        response = conn.getresponse()
        print &quot;EasyRAM.queryInventory() response: status=%s, reason=%s&quot; % (response.status, response.reason)
        print &quot;EasyRAM.queryInventory() response=%s&quot; % response.read()
        conn.close()
    except Exception, ss:
        print &quot;EasyRAM.queryInventory() -&amp;gt; Error=%s&quot; % ss
        raise

    return &#39;&#39;

queryInventory()
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The problem is that i receive the following error message:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Invalid request The parameter,  params , was omitted from the request. Make sure to specify all required parameters, and try the request again. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Like the parameter isn&#39;t passed.&lt;/p&gt;

&lt;p&gt;If I modify my snippet by wrapping my parameter (called &lt;code&gt;params&lt;/code&gt;) into &lt;code&gt;&amp;lt;string&amp;gt;&amp;lt;/string&amp;gt;&lt;/code&gt; in that way:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; xmlrpc_envelope = &#39;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&#39;\
                        &#39;&amp;lt;methodCall&amp;gt;&#39;\
                        &#39;&amp;lt;methodName&amp;gt;easyram&amp;lt;/methodName&amp;gt;&#39;\
                          &#39;&amp;lt;params&amp;gt;&#39;\
                            &#39;&amp;lt;param&amp;gt;&#39;\
                              &#39;&amp;lt;value&amp;gt;&amp;lt;string&amp;gt;%s&amp;lt;/string&amp;gt;&amp;lt;/value&amp;gt;&#39;\
                            &#39;&amp;lt;/param&amp;gt;&#39;\
                          &#39;&amp;lt;/params&amp;gt;&#39;\
                        &#39;&amp;lt;/methodCall&amp;gt;&#39;     
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;something happen, but isn&#39;t what I want; in fact my parameter result to be empty (or void, if you like).&lt;/p&gt;

&lt;p&gt;Any ideas or suggestions?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PS.: I know that exists an xml-rpc library for python called xmlrpclib, but I have to develop in that way, because this is an example for client that can&#39;t use directly a library like that&lt;/strong&gt;&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9171937</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Box2d elastic rope joint</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="box2d-iphone"/>
        <author>
            <name>Sk0prion</name>
            <uri>http://stackoverflow.com/users/820795</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9171937/box2d-elastic-rope-joint" />
        <published>2012-02-07T06:29:37Z</published>
        <updated>2012-02-08T13:44:27Z</updated>
        <summary type="html">
            &lt;p&gt;I&#39;m writing a game, and I need to make up a rope. I maked it by b2RopeJoint, but there I have not found an opportunity to make it elastic.
Then I looked for b2DistanceJoint, everything is cool with the elasticity, but I can&#39;t find an ability to set a limit only to the maximum distance (without minimum one).&lt;/p&gt;

&lt;p&gt;How can I do it?&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9193769</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">disabling view with in action in ZF2</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="zend-framework"/><category scheme="http://stackoverflow.com/feeds/tags" term="zend-framework2"/>
        <author>
            <name>mahi</name>
            <uri>http://stackoverflow.com/users/1197203</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9193769/disabling-view-with-in-action-in-zf2" />
        <published>2012-02-08T12:59:16Z</published>
        <updated>2012-02-08T13:44:23Z</updated>
        <summary type="html">
            &lt;p&gt;I am struggling with disabling view in ZF2 &lt;code&gt;$this-&amp;gt;_helper-&amp;gt;viewRenderer-&amp;gt;setNoRender(); or (true)&lt;/code&gt; with no luck as it always says there &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;PHP Fatal error:  Call to a member function setNoRender() on a non-object in ../module/Location/src/Location/Controller/LocationController.php on line 190
&lt;/code&gt;&lt;/pre&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9193632</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">ksh script + print argument content in shell script</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="linux"/><category scheme="http://stackoverflow.com/feeds/tags" term="bash"/><category scheme="http://stackoverflow.com/feeds/tags" term="shell"/><category scheme="http://stackoverflow.com/feeds/tags" term="unix"/><category scheme="http://stackoverflow.com/feeds/tags" term="ksh"/>
        <author>
            <name>Eytan</name>
            <uri>http://stackoverflow.com/users/1121951</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9193632/ksh-script-print-argument-content-in-shell-script" />
        <published>2012-02-08T12:49:52Z</published>
        <updated>2012-02-08T13:44:23Z</updated>
        <summary type="html">
            &lt;p&gt;I want to run the script.sh with one argument&lt;/p&gt;

&lt;p&gt;if the first argument = action then script.sh will print the action parameter - &quot;restart machine each 1 min&quot;&lt;/p&gt;

&lt;p&gt;My example not work but please advice what need to fix in the script so I will print the $action parameter if argument is action&lt;/p&gt;

&lt;p&gt;Remark I not want to set the following solution - [[ $1 = action ]] &amp;amp;&amp;amp; echo action &quot;restart machine each 1 min&quot;&lt;/p&gt;

&lt;p&gt;My example script&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  #!/bin/ksh




  action=&quot;restart machine each 1 min&quot;


  echo  &quot;action&quot; ${$1}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Example how to run the script&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  ./script.sh action
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Expected results that I need to get :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    action restart machine each 1 min
&lt;/code&gt;&lt;/pre&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194484</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">jquery val.split</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="javascript"/><category scheme="http://stackoverflow.com/feeds/tags" term="jquery"/>
        <author>
            <name>Steeve17</name>
            <uri>http://stackoverflow.com/users/1052141</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194484/jquery-val-split" />
        <published>2012-02-08T13:44:12Z</published>
        <updated>2012-02-08T13:44:12Z</updated>
        <summary type="html">
            &lt;p&gt;I am trying to achieve the following for both @ or #&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function split(val) {
    return val.split(/@/);
}

function extractLast(term) {
    return split(term).pop();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Any help really appreciated! &lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194429</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">updating the primary key and foreign key in multiple tables</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="mysql"/>
        <author>
            <name>Kum</name>
            <uri>http://stackoverflow.com/users/533913</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194429/updating-the-primary-key-and-foreign-key-in-multiple-tables" />
        <published>2012-02-08T13:40:37Z</published>
        <updated>2012-02-08T13:44:04Z</updated>
        <summary type="html">
            &lt;p&gt;I need to update the primary ID value of a record in table_1 and at the same time update the foreign keys referencing that ID value. In the sql below, i have included ALL the tables referencing table_1, however not all of these tables are referencing that particular record.
I am using the sql below:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;UPDATE table_1 T1, 
table_2 T2, 
table_3 T3, 
table_4 T4,
table_5 T5, 
table_6 T6,
table_7 T7
SET T1.EMI_ID = 15678, 
    T2.AKN_EMI_FK = 15678, 
    T3.EXP_EMI_FK = 15678,
    T4.HDR_EMI_FK = 15678, 
    T5.LSU_EMI_FK = 15678,
    T6.MUT_EMI_FK = 15678, 
    T7.IMG_EMI_FK = 15678
WHERE T1.EMI_ID = 77777718765 AND 
T2.AKN_EMI_FK = T1.EMI_ID AND 
T3.EXP_EMI_FK = T1.EMI_ID AND 
T4.HDR_EMI_FK = T1.EMI_ID AND 
T5.LSU_EMI_FK = T1.EMI_ID AND 
T6.MUT_EMI_FK = T1.EMI_ID AND 
T7.IMG_EMI_FK = T1.EMI_ID; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It does not seem to be working and i believe that could be because in some tables that record id does not exist as foreign key.&lt;/p&gt;

&lt;p&gt;Is there a better way of doing this?&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194285</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Rail server crash on RHEL 6</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="ruby-on-rails"/>
        <author>
            <name>Anurag</name>
            <uri>http://stackoverflow.com/users/277375</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194285/rail-server-crash-on-rhel-6" />
        <published>2012-02-08T13:31:11Z</published>
        <updated>2012-02-08T13:44:04Z</updated>
        <summary type="html">
            &lt;p&gt;I&#39;m first timer to Ruby on Rails, trying to set it up on RHEL 6. Since the package manager had very older version of Ruby. I compiled from source with Ruby 1.9.3 and installed rails using &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$gem install rails
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Created a new app using&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$rails new /path/to/newapp
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;but now when I try to run &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$rails server
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;it crashes with given log&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    =&amp;gt; Booting WEBrick
=&amp;gt; Rails 3.2.1 application starting in development on http://0.0.0.0:3000
=&amp;gt; Call with -d to detach
=&amp;gt; Ctrl-C to shutdown server
Exiting
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require&#39;: cannot load such file -- openssl (LoadError)
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/cookie.rb:1:in `&amp;lt;top (required)&amp;gt;&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/session/cookie_store.rb:4:in `&amp;lt;top (required)&amp;gt;&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application/configuration.rb:140:in `const_get&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application/configuration.rb:140:in `session_store&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:268:in `block in default_middleware_stack&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:232:in `tap&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:232:in `default_middleware_stack&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/engine.rb:469:in `app&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application/finisher.rb:31:in `block in &amp;lt;module:Finisher&amp;gt;&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `instance_exec&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `run&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:55:in `block in run_initializers&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `each&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `run_initializers&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:136:in `initialize!&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing&#39;
    from /home/anurag/rubyapp/config/environment.rb:5:in `&amp;lt;top (required)&amp;gt;&#39;
    from /home/anurag/rubyapp/config.ru:4:in `require&#39;
    from /home/anurag/rubyapp/config.ru:4:in `block in &amp;lt;main&amp;gt;&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize&#39;
    from /home/anurag/rubyapp/config.ru:1:in `new&#39;
    from /home/anurag/rubyapp/config.ru:1:in `&amp;lt;main&amp;gt;&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:200:in `app&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands/server.rb:46:in `app&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:252:in `start&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands/server.rb:70:in `start&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:55:in `block in &amp;lt;top (required)&amp;gt;&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap&#39;
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:50:in `&amp;lt;top (required)&amp;gt;&#39;
    from script/rails:6:in `require&#39;
    from script/rails:6:in `&amp;lt;main&amp;gt;&#39;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I&#39;ve tried to search about this error but did not find a working solution. &lt;/p&gt;

&lt;p&gt;Apart from this I&#39;d like to point me to some useful resource which explains best practices in Ruby on Rails.&lt;/p&gt;

&lt;p&gt;-&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194362</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text"> User Controls hide and show</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term=".net"/><category scheme="http://stackoverflow.com/feeds/tags" term="vb.net"/><category scheme="http://stackoverflow.com/feeds/tags" term="winforms"/>
        <author>
            <name>user1190518</name>
            <uri>http://stackoverflow.com/users/1190518</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194362/user-controls-hide-and-show" />
        <published>2012-02-08T13:36:21Z</published>
        <updated>2012-02-08T13:44:02Z</updated>
        <summary type="html">
            &lt;p&gt;I have a couple of user controls, which I show in my main form.&lt;/p&gt;

&lt;p&gt;So let&#39;s say here&#39;s what i want:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Sub Show_Control1()
UserControl1.Show
&#39;CODE TO HIDE EVERY OTHER DISPLAYED USER CONTROL ON THE MAIN FORM
End sub
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;right now I have to hide them one by one with hide, because I don&#39;t know what&#39;s the current displayed form.&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194388</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">How to authorize public users when they access on the specific page, for read-only purposes</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="php"/><category scheme="http://stackoverflow.com/feeds/tags" term="web-development"/><category scheme="http://stackoverflow.com/feeds/tags" term="zend-framework"/><category scheme="http://stackoverflow.com/feeds/tags" term="md5"/>
        <author>
            <name>Miloš Ilić</name>
            <uri>http://stackoverflow.com/users/587228</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194388/how-to-authorize-public-users-when-they-access-on-the-specific-page-for-read-on" />
        <published>2012-02-08T13:37:56Z</published>
        <updated>2012-02-08T13:44:01Z</updated>
        <summary type="html">
            &lt;p&gt;Its general type of question. 
We have web application writen in Zend, and we are making reports for our registred users. Now, we want to create some specific report for nonregistred users and send them link so they can see that report.  But we don&#39;t want to let other users to access that page.&lt;/p&gt;

&lt;p&gt;One idea is to make hashable URN, at least one part, something like &lt;/p&gt;

&lt;p&gt;www.myaddress.com/2309039dskdfskj4/ReportStats/ &lt;/p&gt;

&lt;p&gt;What&#39;s best solution for this problem&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194480</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">My TextView not support this (&#39;) character</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="java"/><category scheme="http://stackoverflow.com/feeds/tags" term="android"/><category scheme="http://stackoverflow.com/feeds/tags" term="android-textview"/>
        <author>
            <name>Špĸ</name>
            <uri>http://stackoverflow.com/users/940096</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194480/my-textview-not-support-this-character" />
        <published>2012-02-08T13:44:00Z</published>
        <updated>2012-02-08T13:44:00Z</updated>
        <summary type="html">
            &lt;p&gt;I just fetched some data from &lt;code&gt;JSon&lt;/code&gt; and listed into my Listview. It&#39;s fetching properly. But, in my listview&#39;s &lt;code&gt;&#39;&lt;/code&gt; character didn&#39;t support there? What&#39;ll i do for this? But, in basically it&#39;s supports when, we use like this -&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;TextView titletv = (TextView)findViewById(R.id.titleTextView);
titletv.setText(&quot;I&#39;m in critical situation&quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It&#39;s displaying fine when we set that character by above code. Otherwise, it won&#39;t supports.&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194236</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Filter right join data in where clause</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="sql"/><category scheme="http://stackoverflow.com/feeds/tags" term="sql-server"/><category scheme="http://stackoverflow.com/feeds/tags" term="sql-server-2000"/>
        <author>
            <name>Nosila</name>
            <uri>http://stackoverflow.com/users/1135049</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194236/filter-right-join-data-in-where-clause" />
        <published>2012-02-08T13:28:28Z</published>
        <updated>2012-02-08T13:43:56Z</updated>
        <summary type="html">
            &lt;p&gt;I have a simple table structure where each item row has a status. What I&#39;m looking is to query for each status and count how many items use that state. It&#39;s possible that not all statuses will be used so I need to account for nulls and zero counts.&lt;/p&gt;

&lt;p&gt;My table structures is as follows:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Table: Items
Id, State_id, Text, Status

Table: States
State_id, Name
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is what I have:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;SELECT   statealias1_.State_id as y0_,
         count(this_.Id)       as y1_
FROM     Items this_
         right join States statealias1_
           on this_.State_id = statealias1_.State_id
WHERE    (not (statealias1_.State_id in (5, 6, 7, 8)) 
            or statealias1_.State_id is null)
         and (this_.Status = &#39;InProgress&#39; 
            or this_.Status is null)
GROUP BY statealias1_.State_id;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This query works when all states included (there are 8 states and I&#39;m excluding the second half). I&#39;m not sure why this isn&#39;t returning me &lt;em&gt;all&lt;/em&gt; states with count regardless of nulls as I appear to be including nulls.&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194479</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">iPad mirror IPHONE app via VGA lead</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="iphone"/><category scheme="http://stackoverflow.com/feeds/tags" term="ipad"/>
        <author>
            <name>Thomas Clayson</name>
            <uri>http://stackoverflow.com/users/414972</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194479/ipad-mirror-iphone-app-via-vga-lead" />
        <published>2012-02-08T13:43:49Z</published>
        <updated>2012-02-08T13:43:49Z</updated>
        <summary type="html">
            &lt;p&gt;We have created an iPhone app which our client wants to show on a projector. They want to do this via an iPad (although the app is designed ONLY for iPhone). The app runs fine on the iPad, but it obviously isn&#39;t mirrored via the VGA cable.&lt;/p&gt;

&lt;p&gt;So the question is, is there an easy way to mirror the output to the iPad screen on the projector? I know I can add the projector as another UIScreen, but my question is really whether there is any easy way to just mirror everything that&#39;s happening?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194478</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Bash - Creating Arrays using loop counter</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="regex"/><category scheme="http://stackoverflow.com/feeds/tags" term="arrays"/><category scheme="http://stackoverflow.com/feeds/tags" term="bash"/>
        <author>
            <name>Mixiul</name>
            <uri>http://stackoverflow.com/users/1197252</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194478/bash-creating-arrays-using-loop-counter" />
        <published>2012-02-08T13:43:48Z</published>
        <updated>2012-02-08T13:43:48Z</updated>
        <summary type="html">
            &lt;p&gt;I am writing a bash script where I need to create arrays inside a for loop and name each array using the string contained in the counter (an array element) each iteration.&lt;/p&gt;

&lt;p&gt;Here is the code: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;myArray=( joe bob dave mark )


for i in &quot;${myArray[@]}&quot;
do
  &quot;$k_array&quot;=( `cat fileUsedToPopulate.txt` )
done

# echo to test if one of the arrays has been created and populated

for j in &quot;${joe_array[@]}&quot;
do
  echo $j
done
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The desired result is 4 arrays, joe_array bob_array etc, each populated with the file.&lt;/p&gt;

&lt;p&gt;However I haven&#39;t found anyway to escape the $k so that it appends to the array name when declaring/populating it. &lt;/p&gt;

&lt;p&gt;Here is the error I am getting: &lt;/p&gt;

&lt;p&gt;line 30: syntax error near unexpected token &lt;code&gt;`cat fileUsedToPopulate.txt&lt;/code&gt;&#39;
line 30: &lt;code&gt;&quot;$k_array&quot;=(&lt;/code&gt;cat $DIR/$braDir/oem.txt` )&#39;&lt;/p&gt;

&lt;p&gt;Thanks for any help provided.&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194262</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Using tokens in web service</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="web-services"/><category scheme="http://stackoverflow.com/feeds/tags" term="authentication"/>
        <author>
            <name>Cris</name>
            <uri>http://stackoverflow.com/users/339500</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194262/using-tokens-in-web-service" />
        <published>2012-02-08T13:29:48Z</published>
        <updated>2012-02-08T13:43:47Z</updated>
        <summary type="html">
            &lt;p&gt;I&#39;m building an app that needs to consume web services; i would like to implement a token-based authentication as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Username/Password are sent to the WS&lt;/li&gt;
&lt;li&gt;If validated, the server sends back a unique token to the client&lt;/li&gt;
&lt;li&gt;The client sends the token in all the following call to the WS and the token expiration time is updated to x minutes after this call.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If i send the username(or userid) in every WS call with the token have i done an acceptable WS architecture or should i do something more to improve security in my app?&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194476</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Fetching data from database with integrity broken</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="c#"/><category scheme="http://stackoverflow.com/feeds/tags" term="mysql"/><category scheme="http://stackoverflow.com/feeds/tags" term="database"/><category scheme="http://stackoverflow.com/feeds/tags" term="sql-server-2008"/>
        <author>
            <name>Goran</name>
            <uri>http://stackoverflow.com/users/916236</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194476/fetching-data-from-database-with-integrity-broken" />
        <published>2012-02-08T13:43:46Z</published>
        <updated>2012-02-08T13:43:46Z</updated>
        <summary type="html">
            &lt;p&gt;Should application expect the unexpected when fetching data from database? Lets say that we have stored an enumeration value in a column (int or text). When we return values from database, we cast the value to enumeration type. What if someone has altered data in database manually, and broke data integrity, so our cast is failing?&lt;/p&gt;

&lt;p&gt;Another example would be when a data type in c# is of less range that equivalent field in database. If anyone puts value in this value manually, lets say to database max value, then application would throw out of range exception.&lt;/p&gt;

&lt;p&gt;Should we and how handle this exceptions?&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9193639</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">printing a php variable as it with all the special characters</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="php"/>
        <author>
            <name>kaninabu</name>
            <uri>http://stackoverflow.com/users/1145315</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9193639/printing-a-php-variable-as-it-with-all-the-special-characters" />
        <published>2012-02-08T12:50:23Z</published>
        <updated>2012-02-08T13:43:45Z</updated>
        <summary type="html">
            &lt;p&gt;Ok I need to find out what is contained inside a PHP variable and I have it to do it visually, is there a function to display whatever that&#39;s contained in a string as it is?&lt;/p&gt;

&lt;p&gt;For example : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$TEST = &#39;&amp;amp;nbsp&#39; . &quot;\n&quot; . &#39; &#39;;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;if I use echo the output will be : &lt;/p&gt;

&lt;p&gt;while i want to to be :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp\n&amp;amp;nbsp
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;is it possible? (I hope I was clear enough)&lt;/p&gt;

&lt;p&gt;ty&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9194475</id>
        <re:rank scheme="http://stackoverflow.com">0</re:rank>
        <title type="text">Populating a listview from another class</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="c#"/>
        <author>
            <name>XandrUu</name>
            <uri>http://stackoverflow.com/users/1134550</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9194475/populating-a-listview-from-another-class" />
        <published>2012-02-08T13:43:42Z</published>
        <updated>2012-02-08T13:43:42Z</updated>
        <summary type="html">
            &lt;p&gt;I&#39;m trying to populate a listview from another class, but I&#39;m geting this error:
&quot; Cross-thread operation not valid: Control &#39;listView1&#39; accessed from a thread other than the thread it was created on. &quot;&lt;/p&gt;

&lt;p&gt;In my class i declar my listview like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class CheckBlankPages
{

    public String[] pdfFiles
    { get; set; }

    ListView _ListVireRef;
    public int NrCRT = 1;


    public CheckBlankPages(String[] pdfFiles = null, ListView listView = null)
    {
        this.pdfFiles = pdfFiles;
        _ListVireRef = listView;

    }
    public void StartCheckingPDF()
    {
        foreach (string pdf in pdfFiles)
        {
            String[] itm = { (NrCRT++).ToString(), pdf };
            ListViewItem item = new ListViewItem(itm);
            _ListVireRef.Items.Add(item);
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and in my MainForm I use this code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;DialogResult rezultat = openFileDialog1.ShowDialog();
        if (rezultat == DialogResult.OK)
        {

            CheckBlankPages ck = new CheckBlankPages(openFileDialog1.FileNames, listView1);
            Thread CheckPDFs = new Thread(new ThreadStart(ck.StartCheckingPDF));
            CheckPDFs.Start();
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Wath is worng?
please help
thansks.&lt;/p&gt;

        </summary>
    </entry>
    <entry>
        <id>http://stackoverflow.com/q/9166025</id>
        <re:rank scheme="http://stackoverflow.com">1</re:rank>
        <title type="text">Order query by input</title>
        <category scheme="http://stackoverflow.com/feeds/tags" term="php"/><category scheme="http://stackoverflow.com/feeds/tags" term="symfony"/><category scheme="http://stackoverflow.com/feeds/tags" term="doctrine"/><category scheme="http://stackoverflow.com/feeds/tags" term="doctrine-1.2"/>
        <author>
            <name>Gunnar</name>
            <uri>http://stackoverflow.com/users/1160628</uri>
        </author>
        <link rel="alternate" href="http://stackoverflow.com/questions/9166025/order-query-by-input" />
        <published>2012-02-06T19:30:23Z</published>
        <updated>2012-02-08T13:43:42Z</updated>
        <summary type="html">
            &lt;p&gt;I do have a query in a table called article.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$q = Doctrine_Query::create()
                    -&amp;gt;from(&#39;article a&#39;)
                    -&amp;gt;WhereIn(&#39;a.name&#39;, $input)
                    -&amp;gt;execute();

$input = array(
    0 =&amp;gt; Tomato,
    1 =&amp;gt; Apple,
    2 =&amp;gt; Banana
); 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I find all inputs. But the output of the query is a different order: Apple, Banana, Tomato. I want the order like the input? How can I realize it?&lt;/p&gt;

        </summary>
    </entry>
</feed>

