-- DBMS: snowflake
create or replace TABLE POSTS_QUESTIONS (
	"id" NUMBER(38,0),
	"title" VARCHAR(16777216),
	"body" VARCHAR(16777216),
	"accepted_answer_id" NUMBER(38,0),
	"answer_count" NUMBER(38,0),
	"comment_count" NUMBER(38,0),
	"community_owned_date" NUMBER(38,0),
	"creation_date" NUMBER(38,0),
	"favorite_count" NUMBER(38,0),
	"last_activity_date" NUMBER(38,0),
	"last_edit_date" NUMBER(38,0),
	"last_editor_display_name" VARCHAR(16777216),
	"last_editor_user_id" NUMBER(38,0),
	"owner_display_name" VARCHAR(16777216),
	"owner_user_id" NUMBER(38,0),
	"parent_id" VARCHAR(16777216),
	"post_type_id" NUMBER(38,0),
	"score" NUMBER(38,0),
	"tags" VARCHAR(16777216),
	"view_count" NUMBER(38,0)
);

INSERT INTO "STACKOVERFLOW_PLUS"."STACKOVERFLOW"."POSTS_QUESTIONS" (last_edit_date, owner_display_name, accepted_answer_id, owner_user_id, tags, last_activity_date, title, body, view_count, community_owned_date, creation_date, post_type_id, answer_count, last_editor_display_name, last_editor_user_id, id, comment_count, favorite_count, parent_id, score) VALUES (1420429826980000, NULL, 27693665.0, 807325, 'php|mysql|simplexml', 1420806718797000, 'How to edit my code to save to mySQL from the beginning of XML?', '<p>I have this XML feed below I am trying to import into MySQL for all the products.
For example, inside the table <code>XML_FEED</code> I want something like</p>

<pre><code>shop        -   product_id - product_name - product_link - .......
mywebstore  -   322233     - MadBiker 600 - .........
mywebstore  -   324633     - Samsung S4 - .........
</code></pre>

<p>The code until now it works only if the XML begins from <code>&lt;products&gt;</code> and not from <code>&lt;mywebstore&gt;</code></p>

<p>How to change my code to do this ?</p>

<pre><code>$xml = simplexml_load_file("test.xml");
foreach($xml-&gt;product as $product)
{
    $columns = array();
    $data = array();
    foreach($product-&gt;children() as $child)
    {
        echo $child-&gt;getName() . ": " . $child . "&lt;br /&gt;";
        $columns[] = $child-&gt;getName();
        $data[] = mysql_real_escape_string((string)$child);
    }
    $col = ''`''. implode(''`,`'',$columns) .''`'';
    $val = "''". implode("'',''",$data)."''";
    $query = "INSERT INTO XML_FEED ($col) VALUES ($val)";
    echo $query;

    mysql_query($query);
}
</code></pre>

<p>Here is the XML:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;mywebstore&gt;
   &lt;created_at&gt;2010-04-08 12:32&lt;/created_at&gt;
   &lt;products&gt;
      &lt;product&gt;
        &lt;id&gt;322233&lt;/id&gt;
        &lt;name&gt;&lt;![CDATA[MadBiker 600]]&gt;&lt;/name&gt;
        &lt;link&gt;&lt;![CDATA[http://www.mywebstore.co.uk/product/322233]]&gt;&lt;/link&gt;
        &lt;image&gt;&lt;![CDATA[http://www.mywebstore.co.uk/product/322233.jpg]]&gt;&lt;/image&gt;
        &lt;category&gt;&lt;![CDATA[Outdor &gt; Extreme Sports]]&gt;&lt;/category&gt;
        &lt;price_with_vat&gt;322.33&lt;/price_with_vat&gt;
      &lt;/product&gt;
      ...
      ...
      ...
   &lt;/products&gt;
&lt;/mywebstore&gt;
</code></pre>', 632, NULL, 1410773929773000, 1, 6, NULL, 1446005, 25844992, 12, nan, NULL, -7), (1495539855347000, NULL, 25593068.0, 1492229, 'android|multithreading|show|progressdialog', 1409496847270000, 'Android : Progress Dialog not working', '<p>I wanted to show a ProgressDialog when data need to be uploaded to the server.</p>

<p>I have checked this question <a href="https://stackoverflow.com/questions/12841803/best-way-to-show-a-loading-spinner">Best way to show a loading/progress indicator?</a>
the best answer was</p>

<pre><code>ProgressDialog progress = new ProgressDialog(this);
progress.setTitle("Loading");
progress.setMessage("Wait while loading...");
progress.show();
// To dismiss the dialog
progress.dismiss();
</code></pre>

<p>when i tried to implement this in my code, nothing showed at all !!
what is that i am doing wrong here?!</p>

<p>this is my code</p>

<pre><code>private void UpdateData()
{

    ProgressDialog progress = new ProgressDialog(this);
    progress.setTitle("Loading");
    progress.setMessage("Wait while loading...");
    progress.show();

    try
    {
        UpdateWSTask updateWSTask = new UpdateWSTask();
        String Resp = updateWSTask.execute().get();

    } catch (InterruptedException e) {
        e.printStackTrace();
    } catch (ExecutionException e) {
        e.printStackTrace();
    }

    progress.dismiss();
</code></pre>

<p>}</p>', 2680, NULL, 1409494978500000, 1, 2, NULL, -1, 25592867, 12, nan, NULL, 0), (1410797371913000, NULL, 25863260.0, 3760661, 'css|less', 1410853484900000, 'How to create a proper class structure?', '<p>I''m using LESS as css compiler.</p>

<p>Everything works fine, but now I need to create a specific class structure and I''m a bit stuck.</p>

<p>I''d like to have this structure:</p>

<pre><code>.default .{color} {.icon-after/.icon-before} {.icon}
</code></pre>

<p>this is the code that I''ve done:</p>

<pre><code>.default {

  &amp;.disabled {
    background: lighten(@grayBackground, 5%);
    color: lighten(@darkText, 35%);
    cursor: default;
    border: @grayBorder;
    text-shadow: @grayTextShadow;
  }

  &amp;.gray {
    background: @grayBackground;
    color: @darkText;
    border: @grayBorder;
    text-shadow: @grayTextShadow;
    &amp;:hover {
      background: darken(@grayBackground, 5%);
    }
  }

  &amp;.green {
    background: @greenBackground;
    border: @greenBorder;
    color: @lightText;
    text-shadow: @greenTextShadow;
    &amp;:hover {
      background: darken(@greenBackground, 10%);
    }
  }

  &amp;.yellow {
    background: @yellowBackground;
    border: @yellowBorder;
    color: @lightText;
    text-shadow: @yellowTextShadow;
    &amp;:hover {
      background: darken(@yellowBackground, 10%);
    }
  }

  &amp;.blue {
    background: @blueBackground;
    border: @blueBorder;
    color: @lightText;
    text-shadow: @blueTextShadow;
    &amp;:hover {
      background: darken(@blueBackground, 10%);
    }
  }

  &amp;.black {
    background: @blackBackground;
    border: @blackBorder;
    color: @lightText;
    text-shadow: @blackTextShadow;
    &amp;:hover {
      background: darken(@blackBackground, 10%);
    }
  }

  &amp;.red {
    background: @redBackground;
    border: @redBorder;
    color: @lightText;
    text-shadow: @redTextShadow;
    &amp;:hover {
      background: darken(@redBackground, 10%);
    }
  }

  &amp;.icon-before{
    .IconDefaultStyleBefore
  }

  &amp;.icon-after{
    .IconDefaultStyleAfter()
  }
}
</code></pre>

<p>obviously this doesn''t work, as the result is something like this:</p>

<pre><code>.default .{color / .icon-after / .icon-before}
</code></pre>

<p>Any suggestions on how can I obtain my structure?</p>

<p>Thanks a lot</p>

<p><strong>EDIT</strong></p>

<p>I''d like to add the classes to the buttons in this order:</p>

<ul>
<li>.default( gives the default style )</li>
<li>{.colours} (so that the background, the border and all colour related properties are setted)</li>
<li>{.icon-after or .icon-before} so that I can choose if adding the icon before or after with the    proper margin</li>
<li>{.icon-name} (for example a questionmark or a tick etc)</li>
</ul>

<p>so, for example, adding this classes:</p>

<pre><code>.default .blue .icon-before .tick
</code></pre>

<p>I will have:</p>

<p><strong>default blue button with the tick icon before the text</strong></p>

<p>Hope is now more clear than before.  </p>', 121, NULL, 1410796077800000, 1, 2, NULL, 1058134, 25851963, 12, nan, NULL, 1), (1409742887083000, NULL, nan, 3987406, 'jquery|css|cursor', 1409742887083000, 'Add effect to crosshair cursor', '<p>I have my cursor set to crosshair whenever it''s over a div set to <code>width: 100%</code> and <code>height: 520px</code>  and I also want to achieve the effect in the image below but I honestly don''t know how?</p>

<p>Those lines have to follow the cursor wherever it goes inside that container.</p>

<p>I searched the internet high and low and couldn''t find anything. Any ideas?
Can it be realized with jquery?</p>

<p><img src="https://i.stack.imgur.com/3xxhV.jpg" alt="enter image description here"></p>

<p>UPDATE:
I managed to do this : <a href="http://jsfiddle.net/brilliancedisplay/wnmcgdwf/3/" rel="nofollow noreferrer">jsFiddle</a></p>

<pre><code>$(document).bind(''mousemove'', function(e){
    $(''#right'').css({
       left:  e.pageX + 20,
       top:   e.pageY
    });

});
</code></pre>', 890, NULL, 1409741930517000, 1, 0, NULL, 3987406, 25642590, 12, 1.0, NULL, 0), (1410209853730000, NULL, nan, 3950946, 'sql|sql-server', 1410211464093000, 'Need to wait on specific column state change in SQL', '<p>I need to check for the status change of a certain column in the table 
I can do it using while loop, where i can get the column value and check the value and break from the loop if value is changed.
i am using SQL server 2008. 
is there a better way?</p>

<p>Here is the sample sql query</p>

<pre><code>   declare @status int = 1

   select @status = status from MyTable with (nolock) where Id = 100034

   while @status &lt;&gt; 3
   begin
      WAITFOR DELAY ''00:01''
      select @status = status from MyTable with (nolock) where Id = 100034
   end
</code></pre>', 1147, NULL, 1410208741190000, 1, 1, NULL, 3950946, 25732803, 12, nan, NULL, 1);