问:
react.js and webpack 2, need a solution
I am doing a sample tutorial with create-react-app and webpack 2, but I am receiving this error:

This is my package.json:

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "babel-core": "^6.22.1",
    "babel-loader": "^6.2.10",
    "babel-preset-latest-minimal": "^1.1.2",
    "babel-preset-react": "^6.22.0",
    "css-loader": "^0.26.1",
    "html-loader": "^0.4.4",
    "json-loader": "^0.5.4",
    "node-sass": "^4.5.0",
    "raw-loader": "^0.5.1",
    "react-scripts": "0.8.5",
    "sass-loader": "^5.0.1",
    "style-loader": "^0.13.1",
    "svgo-loader": "^1.1.2",
    "webpack": "^2.2.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "dependencies": {
    "file-loader": "^0.10.0",
    "react": "^15.4.2",
    "react-dom": "^15.4.2",
    "react-router": "^3.0.2"
  }
}
```

<p>My webpack.config.js:</p>

<pre class="lang-js prettyprint-override"><code>module.exports = {
  context: __dirname,
  entry: {
    app: '../src/index.jsx',

  },
  output: {
    path: './build',
    filename: 'app.js',
  },
  module: {
    loaders: [{
    test: /\.html$/,
    loader: 'html-loader',
    query: {
      minimize: true
    }
  },{
      test: /(\.jsx?)$/,
      loader: 'babel-loader',
      exclude: /(node_modules)/,
      query: {
        presets: ['latest-minimal', 'react'],
      }
    }, {
      test: /\.css$/,
      exclude: /(node_modules)/,
      use: ['style-loader', 'css-loader']
    },{
      test: /\.svg$/,
      use: [{
        loader: 'file-loader'
      }, {
        loader: 'svgo-loader',
        options: {
          plugins: [{
            removeTitle: true
          }, {
            convertColors: {
              shorthex: false
            }
          }, {
            convertPathData: false
          }]
        }
      }]
    }]
  }
}
</code>```

And my index.jsx:

import React, { Component } from 'react';
import { render } from 'react-dom';

import App from './App.jsx';

render(<App />, document.getElementByClass('App'));
```

答: If you still haven't found one I think this is pretty good</p>

Title: react.js and webpack 2, need a solution

Body:
I am doing a sample tutorial with create-react-app and webpack 2, but I am receiving this error:

This is my package.json:

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "babel-core": "^6.22.1",
    "babel-loader": "^6.2.10",
    "babel-preset-latest-minimal": "^1.1.2",
    "babel-preset-react": "^6.22.0",
    "css-loader": "^0.26.1",
    "html-loader": "^0.4.4",
    "json-loader": "^0.5.4",
    "node-sass": "^4.5.0",
    "raw-loader": "^0.5.1",
    "react-scripts": "0.8.5",
    "sass-loader": "^5.0.1",
    "style-loader": "^0.13.1",
    "svgo-loader": "^1.1.2",
    "webpack": "^2.2.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "dependencies": {
    "file-loader": "^0.10.0",
    "react": "^15.4.2",
    "react-dom": "^15.4.2",
    "react-router": "^3.0.2"
  }
}

My webpack.config.js:

module.exports = {
  context: __dirname,
  entry: {
    app: '../src/index.jsx',

  },
  output: {
    path: './build',
    filename: 'app.js',
  },
  module: {
    loaders: [{
    test: /\.html$/,
    loader: 'html-loader',
    query: {
      minimize: true
    }
  },{
      test: /(\.jsx?)$/,
      loader: 'babel-loader',
      exclude: /(node_modules)/,
      query: {
        presets: ['latest-minimal', 'react'],
      }
    }, {
      test: /\.css$/,
      exclude: /(node_modules)/,
      use: ['style-loader', 'css-loader']
    },{
      test: /\.svg$/,
      use: [{
        loader: 'file-loader'
      }, {
        loader: 'svgo-loader',
        options: {
          plugins: [{
            removeTitle: true
          }, {
            convertColors: {
              shorthex: false
            }
          }, {
            convertPathData: false
          }]
        }
      }]
    }]
  }
}

And my index.jsx:

import React, { Component } from 'react';
import { render } from 'react-dom';

import App from './App.jsx';

render(<App />, document.getElementByClass('App'));


来源: stackexchange

问:
How to order a list of paragraphs
A have a list:

§ 21 Item

§ 1 Item

§ 13 Item

§ 3 Item

§ 2 Item

I need to order it like this:

§ 1 Item

§ 2 Item

§ 3 Item

§ 13 Item

§ 21 Item

But after

```<code>newList = (from a in list orderby a.Name ascending select a).ToList();
</code>```

I get this:

§ 1 Item

§ 13 Item

§ 2 Item

§ 21 Item

§ 3 Item

How to fix it?

答:
to accomodate blank entry</p>

```<code>newList = (from a in list
           orderby String.IsNullOrEmpty(a)
                     ? -1
                     : int.Parse(a.Name.Split(" ")[1]) ascending
           select a).ToList();
</code>```

ContentLicense: CC BY-SA 2.5

Title: How to order a list of paragraphs

Body:
A have a list:

§ 21 Item

§ 1 Item

§ 13 Item

§ 3 Item

§ 2 Item

I need to order it like this:

§ 1 Item

§ 2 Item

§ 3 Item

§ 13 Item

§ 21 Item

But after

newList = (from a in list orderby a.Name ascending select a).ToList();

I get this:

§ 1 Item

§ 13 Item

§ 2 Item

§ 21 Item

§ 3 Item

How to fix it?

Body:
to accomodate blank entry

newList = (from a in list
           orderby String.IsNullOrEmpty(a)
                     ? -1
                     : int.Parse(a.Name.Split(" ")[1]) ascending
           select a).ToList();


问:
Jenkins multi branch project and Github webhooks
Looks like I'm missing something.

I set up multibrunch jon in Jenkins with SCM like git@github.someorg.com/repo.git It scanned all current branches.

Then I set up web hook in Github with URL http://jenkins.someorg.com/github-webhook/ for all events.

Github shows that event has been successfully sent.
Jenkins log shows that events has bees received.

```<code>Received PUSH for https://github.someorg.com/repo from IP ⇒ http://jenkins.someorg.com/github-webhook/
</code>```

But nothing happens on the Jenkins job itself...

答: Found solution. I was using Git repo. But when I switched to Github with API key, everything worked</p>

ContentLicense: CC BY-SA 3.0

Body:
Looks like I'm missing something.

I set up multibrunch jon in Jenkins with SCM like git@github.someorg.com/repo.git It scanned all current branches.

Then I set up web hook in Github with URL http://jenkins.someorg.com/github-webhook/ for all events.

Github shows that event has been successfully sent.
Jenkins log shows that events has bees received.

Received PUSH for https://github.someorg.com/repo from IP ⇒ http://jenkins.someorg.com/github-webhook/

But nothing happens on the Jenkins job itself...


问:
Unable to read output from barcode scanner
I want to upload the result from the barcode scanner to the edit text, but it is not displaying in the edit text. May I know what the problem is and how do I solve it?

This is my code

```<code>import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.zxing.Result;
import me.dm7.barcodescanner.zxing.ZXingScannerView;

public class ScannerActivity extends AppCompatActivity {
private ZXingScannerView scannerView;
private EditText ScanBarcode;
 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_scanner);

    ScanBarcode = (EditText)findViewById(R.id.editscanbar);
}

public void scanCode(View view){
    scannerView = new ZXingScannerView(this);
    scannerView.setResultHandler(new ZXingScannerResultHandler());

    setContentView(scannerView);
    scannerView.startCamera();
}
@Override
public void onPause(){
    super.onPause();
    scannerView.stopCamera();
}

class ZXingScannerResultHandler implements ZXingScannerView.ResultHandler{
            @Override
            public void handleResult(Result result){
                String resultCode = result.getText().toString();
                ScanBarcode.setText(resultCode);
                Toast.makeText(ScannerActivity.this, resultCode,
Toast.LENGTH_SHORT).show();

                setContentView(R.layout.activity_scanner);
                scannerView.stopCamera();

    }
}
}
</code>```

I've changed it and there is still nothing showing up in the edit text

```<code>import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.google.zxing.Result;
import me.dm7.barcodescanner.zxing.ZXingScannerView;

public class ScannerActivity extends AppCompatActivity implements
ZXingScannerView.ResultHandler {
private ZXingScannerView mScannerView;
private EditText ScanBarcode;
@Override
public void onCreate(Bundle State) {
    super.onCreate(State);
    mScannerView = new ZXingScannerView(this);
    setContentView(R.layout.activity_scanner);

    ScanBarcode = (EditText)findViewById(R.id.editscanbar);
}

public void scanCode(View view){
    mScannerView.setResultHandler(this);

    setContentView(mScannerView);
    mScannerView.startCamera();
}
@Override
public void onResume(){
    super.onResume();
    mScannerView.setResultHandler(this);
    mScannerView.startCamera();
}

@Override
public void onPause(){
    super.onPause();
    mScannerView.stopCamera();
}
@Override
public void handleResult(Result rawResult){
    ScanBarcode.setText(rawResult.getText());

    setContentView(R.layout.activity_scanner);
    mScannerView.stopCamera();
}

}
</code>```

答:
you should implement the ResultHandler in your Activity, override the callback method and there set the result of the scan in your EditText, example:

```<code>public class SimpleScannerActivity extends Activity implements ZXingScannerView.ResultHandler {
private ZXingScannerView mScannerView;
private EditText editText;

@Override
public void onCreate(Bundle state) {
    super.onCreate(state);
    mScannerView = new ZXingScannerView(this);   // Programmatically initialize the scanner view
    setContentView(mScannerView);                // Set the scanner view as the content view

    EditText editText = (EditText)findViewById(R.id.myedittext);
}

@Override
public void onResume() {
    super.onResume();
    mScannerView.setResultHandler(this); // Register ourselves as a handler for scan results.
    mScannerView.startCamera();          // Start camera on resume
}

@Override
public void onPause() {
    super.onPause();
    mScannerView.stopCamera();           // Stop camera on pause
}

@Override
public void handleResult(Result rawResult) {
    // Do something with the result here
    editText.setText(rawResult.getText());
    Log.v(TAG, rawResult.getText()); // Prints scan results
    Log.v(TAG, rawResult.getBarcodeFormat().toString()); // Prints the scan format (qrcode, pdf417 etc.)

    // If you would like to resume scanning, call this method below:
    mScannerView.resumeCameraPreview(this);
}
}
</code>```

Hope it helps!

Body:
I want to upload the result from the barcode scanner to the edit text, but it is not displaying in the edit text. May I know what the problem is and how do I solve it?

This is my code

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.zxing.Result;
import me.dm7.barcodescanner.zxing.ZXingScannerView;

public class ScannerActivity extends AppCompatActivity {
private ZXingScannerView scannerView;
private EditText ScanBarcode;
 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_scanner);

    ScanBarcode = (EditText)findViewById(R.id.editscanbar);
}

public void scanCode(View view){
    scannerView = new ZXingScannerView(this);
    scannerView.setResultHandler(new ZXingScannerResultHandler());

    setContentView(scannerView);
    scannerView.startCamera();
}
@Override
public void onPause(){
    super.onPause();
    scannerView.stopCamera();
}

class ZXingScannerResultHandler implements ZXingScannerView.ResultHandler{
            @Override
            public void handleResult(Result result){
                String resultCode = result.getText().toString();
                ScanBarcode.setText(resultCode);
                Toast.makeText(ScannerActivity.this, resultCode,
Toast.LENGTH_SHORT).show();

                setContentView(R.layout.activity_scanner);
                scannerView.stopCamera();

    }
}
}

I've changed it and there is still nothing showing up in the edit text

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.google.zxing.Result;
import me.dm7.barcodescanner.zxing.ZXingScannerView;

public class ScannerActivity extends AppCompatActivity implements
ZXingScannerView.ResultHandler {
private ZXingScannerView mScannerView;
private EditText ScanBarcode;
@Override
public void onCreate(Bundle State) {
    super.onCreate(State);
    mScannerView = new ZXingScannerView(this);
    setContentView(R.layout.activity_scanner);

    ScanBarcode = (EditText)findViewById(R.id.editscanbar);
}

public void scanCode(View view){
    mScannerView.setResultHandler(this);

    setContentView(mScannerView);
    mScannerView.startCamera();
}
@Override
public void onResume(){
    super.onResume();
    mScannerView.setResultHandler(this);
    mScannerView.startCamera();
}

@Override
public void onPause(){
    super.onPause();
    mScannerView.stopCamera();
}
@Override
public void handleResult(Result rawResult){
    ScanBarcode.setText(rawResult.getText());

    setContentView(R.layout.activity_scanner);
    mScannerView.stopCamera();
}

}

Body:
you should implement the ResultHandler in your Activity, override the callback method and there set the result of the scan in your EditText, example:

public class SimpleScannerActivity extends Activity implements ZXingScannerView.ResultHandler {
private ZXingScannerView mScannerView;
private EditText editText;

@Override
public void onCreate(Bundle state) {
    super.onCreate(state);
    mScannerView = new ZXingScannerView(this);   // Programmatically initialize the scanner view
    setContentView(mScannerView);                // Set the scanner view as the content view

    EditText editText = (EditText)findViewById(R.id.myedittext);
}

@Override
public void onResume() {
    super.onResume();
    mScannerView.setResultHandler(this); // Register ourselves as a handler for scan results.
    mScannerView.startCamera();          // Start camera on resume
}

@Override
public void onPause() {
    super.onPause();
    mScannerView.stopCamera();           // Stop camera on pause
}

@Override
public void handleResult(Result rawResult) {
    // Do something with the result here
    editText.setText(rawResult.getText());
    Log.v(TAG, rawResult.getText()); // Prints scan results
    Log.v(TAG, rawResult.getBarcodeFormat().toString()); // Prints the scan format (qrcode, pdf417 etc.)

    // If you would like to resume scanning, call this method below:
    mScannerView.resumeCameraPreview(this);
}
}

Hope it helps!


问:
REST URL for a resource
I have doubt since a long time regarding the URL link for resources like user and questions here on stack exchange sites. When I goto my profile page I expect something like:

https://stackoverflow.com/users/codeyogi

But I see:

https://stackoverflow.com/users/4260745/codeyogi

Why there is an extra random number? since the user names are unique.

答: The number is probably not random. It's the unique user ID of your account. The website probably wants to allow the same name for multiple people like "John" for example. However, John "A" is different from John "B" and the way to distinguish that is by a unique user ID.</p>

Title: REST URL for a resource


问:
Why does WordPress prefix its column names with the table name?
I noticed that in a recent update WordPress decided to change all of its column names to include the table name prefix. WHY?!

The wp_posts table now has a column called post_title, for example. It used to just be title. I don't understand the reason for this change. There must've been one, yes?

I just don't understand what possible reason there could be since in SQL you can refer to things like table.column. Also, it must've been really difficult to change all of the code.

答:
There is no good reason for doing this, plus it makes maintenance much more difficult.

There is no confusion if columns are specified like:

```<code>SELECT p.title, s.title FROM wp_posts p JOIN site s ON (p.site_id = s.id);
</code>```

Body:
There is no good reason for doing this, plus it makes maintenance much more difficult.

There is no confusion if columns are specified like:

SELECT p.title, s.title FROM wp_posts p JOIN site s ON (p.site_id = s.id);


问:
How to aggregate some data in pandas DataFrame
I have dataframe like this:

```<code>df = pd.DataFrame({'id': [115,120,200], 'category': ['a','a', 'b'], 'clust': [1, 2, 3]})
</code>```

I want to aggregate and count the amount of id of every category, which is in particular clust. For instance, result can also data frame where index row is clust and index column is category and values are amount of id

答:
IIUC, let's use groupby and unstack:

```<code>import pandas as pd
df = pd.DataFrame({'id': [115,120,200], 'category': ['a', 'a', 'b'], 'clust': [1, 2, 3]})
df
</code>```

Input Dataframe:

```<code>  category  clust   id
0        a      1  115
1        a      2  120
2        b      3  200
</code>```

Group, aggegrate and reshape:

```<code>df_out = df.groupby(['clust','category'])['id'].count().unstack()
</code>```

Output:

```<code>category    a    b
clust
1         1.0  NaN
2         1.0  NaN
3         NaN  1.0
</code>```

Body:
I have dataframe like this:

df = pd.DataFrame({'id': [115,120,200], 'category': ['a','a', 'b'], 'clust': [1, 2, 3]})

I want to aggregate and count the amount of id of every category, which is in particular clust. For instance, result can also data frame where index row is clust and index column is category and values are amount of id

Body:
IIUC, let's use groupby and unstack:

import pandas as pd
df = pd.DataFrame({'id': [115,120,200], 'category': ['a', 'a', 'b'], 'clust': [1, 2, 3]})
df

Input Dataframe:

  category  clust   id
0        a      1  115
1        a      2  120
2        b      3  200

Group, aggegrate and reshape:

df_out = df.groupby(['clust','category'])['id'].count().unstack()

Output:

category    a    b
clust
1         1.0  NaN
2         1.0  NaN
3         NaN  1.0


问:
how to vectorize the args of a function in R?
I have a list in R and I'm trying to rename the list members from a character array. For instance:

```<code>mylist <- list(c('a','b','c'),c('d','e'),'f')
headers <- c('heading1','heading2','heading3')
</code>```

And I can rename the list members like this:

```<code>names(mylist) <- c(headers[1],
                   headers[2],
                   headers[3])
</code>```

But when my list is 100s of members long, this code is horrible to write. I've tried using a for-loop as well as vectorized notation but nothing works. Apologies for what is doubtless a duplicate question but I've searched a lot of false leads in trying to google it

答:
You can use the paste function to create numbered headers sequentially in a for loop. Then use the above answer to assign the headers to names of the list. </p>

```<code>mylist <- list(c('a','b','c'),c('d','e'),'f')
headers <- rep(NA, length(mylist))
for (i in 1:length(mylist)){
  headers[i] <- paste("heading", i, sep = "")
}
names(mylist) <- headers
</code>```

Body:
I have a list in R and I'm trying to rename the list members from a character array. For instance:

mylist <- list(c('a','b','c'),c('d','e'),'f')
headers <- c('heading1','heading2','heading3')

And I can rename the list members like this:

names(mylist) <- c(headers[1],
                   headers[2],
                   headers[3])

But when my list is 100s of members long, this code is horrible to write. I've tried using a for-loop as well as vectorized notation but nothing works. Apologies for what is doubtless a duplicate question but I've searched a lot of false leads in trying to google it

Body:
You can use the paste function to create numbered headers sequentially in a for loop. Then use the above answer to assign the headers to names of the list.

mylist <- list(c('a','b','c'),c('d','e'),'f')
headers <- rep(NA, length(mylist))
for (i in 1:length(mylist)){
  headers[i] <- paste("heading", i, sep = "")
}
names(mylist) <- headers


问:
Formula in worksheet and VBA works differently
Cell A1 contains the number 25, which is right-aligned, implying it's a number, not text.

D1 contains the formula:

="" & A1

The 25 in D1 is left-aligned, implying it's text. That is confirmed by the following formula, which returns 1:

=IF(D1="25",1,0)

The following VBA code puts 25 in F1 but the 25 is right-aligned and the IF test returns 0:

```<code>Range("F1") = "" & Range("A1")
</code>```

Any explanation for the discrepancy?

E1 contains the following formula which gives a left-aligned 25 and the IF test returns 1:

TEXT(A1,"0")

However, the following code gives a right-aligned 25 and the IF test returns 0:

```<code>Range("F1") = Application.WorksheetFunction.Text(Range("A1"), "0")
</code>```

Not that I have to use the TEXT function. I just wonder why it works differently than when in a worksheet.

Any rule that tells when or what worksheet functions won't work in VBA code, or more precisely, will give different results than when in worksheet?

答:
The cell alignment says nothing about the cell's contents. Forget about anything being "implied" by it. When you start on a virgin worksheet the format for all cells is "General" which means that Excel will decide the format of what you enter. If you enter a number the format will be "Number". If you enter what looks like a date to Excel the format will be "Date", and for most other things the format will be "Text".
So, if you enter "    25" in a cell formatted as "General" Excel will recognise this to be a number despite the leading spaces, read it is numeric, and format the cell to the right. This will happen regardless of whether you made the entry by hand or used VBA. You can then proceed to format the alignment as you wish.
However, if you enter the number 25 in a cell formatted as Text Excel will recognise the number as text and display it formatted to the left (unless you expressly formatted the horizontal alignment to the right).

The best way to deal with any problems you might encounter in this regard, set the NumberFormat and HorizontalAlignment properties for the cells that you want to write to. You can do that both manually or using VBA.

Body:
Cell A1 contains the number 25, which is right-aligned, implying it's a number, not text.

D1 contains the formula:

="" & A1

The 25 in D1 is left-aligned, implying it's text. That is confirmed by the following formula, which returns 1:

=IF(D1="25",1,0)

The following VBA code puts 25 in F1 but the 25 is right-aligned and the IF test returns 0:

Range("F1") = "" & Range("A1")

Any explanation for the discrepancy?

E1 contains the following formula which gives a left-aligned 25 and the IF test returns 1:

TEXT(A1,"0")

However, the following code gives a right-aligned 25 and the IF test returns 0:

Range("F1") = Application.WorksheetFunction.Text(Range("A1"), "0")

Not that I have to use the TEXT function. I just wonder why it works differently than when in a worksheet.

Any rule that tells when or what worksheet functions won't work in VBA code, or more precisely, will give different results than when in worksheet?


问:
Wordpress have_posts() doesn't work in loop
I created a custom post type in my functions.php:

```<code>add_action( 'init', 'create_post_type' );
function create_post_type() {
    register_post_type(
       'specialities',
        array(
            'labels' => array(
                'name' => __( 'Besonderheiten' ),
                'singular_name' => __( 'Besonderheit' )
            ),
            'public' => true,
            'has_archive' => true,
            'supports' => array('title', 'editor', 'thumbnail')
        )
    );
}
</code>```

then i added some posts in the wp-admin section.

I queried all posts:

```<code>$args = query_posts( array(
        'post_type'  => 'specialities',
        'posts_per_page' => -1
    ));
$query = new WP_Query($args);
</code>```

To make sure that $query isn't empty i var_dumped the whole thing -> It isn't empty. The var_dump showed all my posts.

So i tried to loop this query:

```<code><?php if(!empty($query)){ ?>
    <div class="slideshow clearfix">
        <?php while ( $query->have_posts() ) : $query->the_post(); ?>
            <div class="specialities clearfix"><?php echo the_title(); ?></div>
        <?php endwhile; ?>
    </div>
<?php } ?>
</code>```

In the web inspector i can see the div (slideshow clearfix) but no child divs (specialities clearfix).. Why???

So in case here's the var_dump:

object(WP_Query)#6956 (48) { ["query"]=> array(5) { [0]=> object(WP_Post)#6961 (24) { ["ID"]=> int(59) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:03:19" ["post_date_gmt"]=> string(19) "2017-07-07 19:03:19" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(8) "Beispiel" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(8) "beispiel" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:03:42" ["post_modified_gmt"]=> string(19) "2017-07-07 19:03:42" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [1]=> object(WP_Post)#6923 (24) { ["ID"]=> int(57) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:01:06" ["post_date_gmt"]=> string(19) "2017-07-07 19:01:06" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(8) "Spaetzle" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(8) "spaetzle" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:01:06" ["post_modified_gmt"]=> string(19) "2017-07-07 19:01:06" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [2]=> object(WP_Post)#6960 (24) { ["ID"]=> int(55) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:00:11" ["post_date_gmt"]=> string(19) "2017-07-07 19:00:11" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(14) "Pasta Pomodoro" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(14) "pasta-pomodoro" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:00:11" ["post_modified_gmt"]=> string(19) "2017-07-07 19:00:11" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [3]=> object(WP_Post)#6998 (24) { ["ID"]=> int(53) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 20:57:49" ["post_date_gmt"]=> string(19) "2017-07-07 18:57:49" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(24) "Pasta Tomaten Mozzarella" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(2) "53" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 20:59:08" ["post_modified_gmt"]=> string(19) "2017-07-07 18:59:08" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [4]=> object(WP_Post)#6995 (24) { ["ID"]=> int(51) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 20:56:44" ["post_date_gmt"]=> string(19) "2017-07-07 18:56:44" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(9) "Hamburger" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(9) "hamburger" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 20:56:44" ["post_modified_gmt"]=> string(19) "2017-07-07 18:56:44" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } } ["query_vars"]=> array(69) { [0]=> object(WP_Post)#6961 (24) { ["ID"]=> int(59) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:03:19" ["post_date_gmt"]=> string(19) "2017-07-07 19:03:19" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(8) "Beispiel" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(8) "beispiel" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:03:42" ["post_modified_gmt"]=> string(19) "2017-07-07 19:03:42" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [1]=> object(WP_Post)#6923 (24) { ["ID"]=> int(57) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:01:06" ["post_date_gmt"]=> string(19) "2017-07-07 19:01:06" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(8) "Spaetzle" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(8) "spaetzle" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:01:06" ["post_modified_gmt"]=> string(19) "2017-07-07 19:01:06" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [2]=> object(WP_Post)#6960 (24) { ["ID"]=> int(55) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:00:11" ["post_date_gmt"]=> string(19) "2017-07-07 19:00:11" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(14) "Pasta Pomodoro" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(14) "pasta-pomodoro" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:00:11" ["post_modified_gmt"]=> string(19) "2017-07-07 19:00:11" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [3]=> object(WP_Post)#6998 (24) { ["ID"]=> int(53) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 20:57:49" ["post_date_gmt"]=> string(19) "2017-07-07 18:57:49" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(24) "Pasta Tomaten Mozzarella" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(2) "53" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 20:59:08" ["post_modified_gmt"]=> string(19) "2017-07-07 18:59:08" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [4]=> object(WP_Post)#6995 (24) { ["ID"]=> int(51) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 20:56:44" ["post_date_gmt"]=> string(19) "2017-07-07 18:56:44" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(9) "Hamburger" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(9) "hamburger" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 20:56:44" ["post_modified_gmt"]=> string(19) "2017-07-07 18:56:44" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } ["error"]=> string(0) "" ["m"]=> string(0) "" ["p"]=> int(0) ["post_parent"]=> string(0) "" ["subpost"]=> string(0) "" ["subpost_id"]=> string(0) "" ["attachment"]=> string(0) "" ["attachment_id"]=> int(0) ["name"]=> string(0) "" ["static"]=> string(0) "" ["pagename"]=> string(0) "" ["page_id"]=> int(0) ["second"]=> string(0) "" ["minute"]=> string(0) "" ["hour"]=> string(0) "" ["day"]=> int(0) ["monthnum"]=> int(0) ["year"]=> int(0) ["w"]=> int(0) ["category_name"]=> string(0) "" ["tag"]=> string(0) "" ["cat"]=> string(0) "" ["tag_id"]=> string(0) "" ["author"]=> string(0) "" ["author_name"]=> string(0) "" ["feed"]=> string(0) "" ["tb"]=> string(0) "" ["paged"]=> int(0) ["meta_key"]=> string(0) "" ["meta_value"]=> string(0) "" ["preview"]=> string(0) "" ["s"]=> string(0) "" ["sentence"]=> string(0) "" ["title"]=> string(0) "" ["fields"]=> string(0) "" ["menu_order"]=> string(0) "" ["embed"]=> string(0) "" ["category__in"]=> array(0) { } ["category__not_in"]=> array(0) { } ["category__and"]=> array(0) { } ["post__in"]=> array(0) { } ["post__not_in"]=> array(0) { } ["post_name__in"]=> array(0) { } ["tag__in"]=> array(0) { } ["tag__not_in"]=> array(0) { } ["tag__and"]=> array(0) { } ["tag_slug__in"]=> array(0) { } ["tag_slug__and"]=> array(0) { } ["post_parent__in"]=> array(0) { } ["post_parent__not_in"]=> array(0) { } ["author__in"]=> array(0) { } ["author__not_in"]=> array(0) { } ["ignore_sticky_posts"]=> bool(false) ["suppress_filters"]=> bool(false) ["cache_results"]=> bool(true) ["update_post_term_cache"]=> bool(true) ["lazy_load_term_meta"]=> bool(true) ["update_post_meta_cache"]=> bool(true) ["post_type"]=> string(0) "" ["posts_per_page"]=> int(10) ["nopaging"]=> bool(false) ["comments_per_page"]=> string(2) "50" ["no_found_rows"]=> bool(false) ["order"]=> string(4) "DESC" } ["tax_query"]=> object(WP_Tax_Query)#7005 (6) { ["queries"]=> array(0) { } ["relation"]=> string(3) "AND" ["table_aliases":protected]=> array(0) { } ["queried_terms"]=> array(0) { } ["primary_table"]=> string(8) "wp_posts" ["primary_id_column"]=> string(2) "ID" } ["meta_query"]=> object(WP_Meta_Query)#7004 (9) { ["queries"]=> array(0) { } ["relation"]=> NULL ["meta_table"]=> NULL ["meta_id_column"]=> NULL ["primary_table"]=> NULL ["primary_id_column"]=> NULL ["table_aliases":protected]=> array(0) { } ["clauses":protected]=> array(0) { } ["has_or_relation":protected]=> bool(false) } ["date_query"]=> bool(false) ["request"]=> string(259) "SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 0, 10" ["posts"]=> array(0) { } ["post_count"]=> int(0) ["current_post"]=> int(-1) ["in_the_loop"]=> bool(false) ["comment_count"]=> int(0) ["current_comment"]=> int(-1) ["found_posts"]=> int(0) ["max_num_pages"]=> int(0) ["max_num_comment_pages"]=> int(0) ["is_single"]=> bool(false) ["is_preview"]=> bool(false) ["is_page"]=> bool(false) ["is_archive"]=> bool(false) ["is_date"]=> bool(false) ["is_year"]=> bool(false) ["is_month"]=> bool(false) ["is_day"]=> bool(false) ["is_time"]=> bool(false) ["is_author"]=> bool(false) ["is_category"]=> bool(false) ["is_tag"]=> bool(false) ["is_tax"]=> bool(false) ["is_search"]=> bool(false) ["is_feed"]=> bool(false) ["is_comment_feed"]=> bool(false) ["is_trackback"]=> bool(false) ["is_home"]=> bool(true) ["is_404"]=> bool(false) ["is_embed"]=> bool(false) ["is_paged"]=> bool(false) ["is_admin"]=> bool(false) ["is_attachment"]=> bool(false) ["is_singular"]=> bool(false) ["is_robots"]=> bool(false) ["is_posts_page"]=> bool(false) ["is_post_type_archive"]=> bool(false) ["query_vars_hash":"WP_Query":private]=> string(32) "efaea6907a432061160b874915d6ab95" ["query_vars_changed":"WP_Query":private]=> bool(false) ["thumbnails_cached"]=> bool(false) ["stopwords":"WP_Query":private]=> NULL ["compat_fields":"WP_Query":private]=> array(2) { [0]=> string(15) "query_vars_hash" [1]=> string(18) "query_vars_changed" } ["compat_methods":"WP_Query":private]=> array(2) { [0]=> string(16) "init_query_flags" [1]=> string(15) "parse_tax_query" } }

答:
In your query you use two function query_posts() and WP_Query().

```<code>$args = query_posts( array(
        'post_type'  => 'specialities',
        'posts_per_page' => -1
    ));
$query = new WP_Query($args);
</code>```

query_posts() and WP_Query() two are different functions.

You can use following code

```<code>$args = array(
    'post_type'  => 'specialities',
    'posts_per_page' => -1
);
$query = new WP_Query($args);
</code>```

Ref.
- https://codex.wordpress.org/User:JamesVL/query_posts

-https://codex.wordpress.org/Class_Reference/WP_Query

Body:
I created a custom post type in my functions.php:

add_action( 'init', 'create_post_type' );
function create_post_type() {
    register_post_type(
       'specialities',
        array(
            'labels' => array(
                'name' => __( 'Besonderheiten' ),
                'singular_name' => __( 'Besonderheit' )
            ),
            'public' => true,
            'has_archive' => true,
            'supports' => array('title', 'editor', 'thumbnail')
        )
    );
}

then i added some posts in the wp-admin section.

I queried all posts:

$args = query_posts( array(
        'post_type'  => 'specialities',
        'posts_per_page' => -1
    ));
$query = new WP_Query($args);

To make sure that $query isn't empty i var_dumped the whole thing -> It isn't empty. The var_dump showed all my posts.

So i tried to loop this query:

<?php if(!empty($query)){ ?>

        <?php while ( $query->have_posts() ) : $query->the_post(); ?>

<?php echo the_title(); ?>

        <?php endwhile; ?>

<?php } ?>

In the web inspector i can see the div (slideshow clearfix) but no child divs (specialities clearfix).. Why???

So in case here's the var_dump:

object(WP_Query)#6956 (48) { ["query"]=> array(5) { [0]=> object(WP_Post)#6961 (24) { ["ID"]=> int(59) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:03:19" ["post_date_gmt"]=> string(19) "2017-07-07 19:03:19" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(8) "Beispiel" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(8) "beispiel" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:03:42" ["post_modified_gmt"]=> string(19) "2017-07-07 19:03:42" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [1]=> object(WP_Post)#6923 (24) { ["ID"]=> int(57) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:01:06" ["post_date_gmt"]=> string(19) "2017-07-07 19:01:06" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(8) "Spaetzle" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(8) "spaetzle" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:01:06" ["post_modified_gmt"]=> string(19) "2017-07-07 19:01:06" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [2]=> object(WP_Post)#6960 (24) { ["ID"]=> int(55) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:00:11" ["post_date_gmt"]=> string(19) "2017-07-07 19:00:11" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(14) "Pasta Pomodoro" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(14) "pasta-pomodoro" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:00:11" ["post_modified_gmt"]=> string(19) "2017-07-07 19:00:11" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [3]=> object(WP_Post)#6998 (24) { ["ID"]=> int(53) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 20:57:49" ["post_date_gmt"]=> string(19) "2017-07-07 18:57:49" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(24) "Pasta Tomaten Mozzarella" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(2) "53" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 20:59:08" ["post_modified_gmt"]=> string(19) "2017-07-07 18:59:08" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [4]=> object(WP_Post)#6995 (24) { ["ID"]=> int(51) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 20:56:44" ["post_date_gmt"]=> string(19) "2017-07-07 18:56:44" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(9) "Hamburger" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(9) "hamburger" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 20:56:44" ["post_modified_gmt"]=> string(19) "2017-07-07 18:56:44" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } } ["query_vars"]=> array(69) { [0]=> object(WP_Post)#6961 (24) { ["ID"]=> int(59) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:03:19" ["post_date_gmt"]=> string(19) "2017-07-07 19:03:19" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(8) "Beispiel" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(8) "beispiel" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:03:42" ["post_modified_gmt"]=> string(19) "2017-07-07 19:03:42" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [1]=> object(WP_Post)#6923 (24) { ["ID"]=> int(57) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:01:06" ["post_date_gmt"]=> string(19) "2017-07-07 19:01:06" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(8) "Spaetzle" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(8) "spaetzle" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:01:06" ["post_modified_gmt"]=> string(19) "2017-07-07 19:01:06" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [2]=> object(WP_Post)#6960 (24) { ["ID"]=> int(55) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 21:00:11" ["post_date_gmt"]=> string(19) "2017-07-07 19:00:11" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(14) "Pasta Pomodoro" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(14) "pasta-pomodoro" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 21:00:11" ["post_modified_gmt"]=> string(19) "2017-07-07 19:00:11" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [3]=> object(WP_Post)#6998 (24) { ["ID"]=> int(53) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 20:57:49" ["post_date_gmt"]=> string(19) "2017-07-07 18:57:49" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(24) "Pasta Tomaten Mozzarella" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(2) "53" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 20:59:08" ["post_modified_gmt"]=> string(19) "2017-07-07 18:59:08" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [4]=> object(WP_Post)#6995 (24) { ["ID"]=> int(51) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2017-07-07 20:56:44" ["post_date_gmt"]=> string(19) "2017-07-07 18:56:44" ["post_content"]=> string(591) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ["post_title"]=> string(9) "Hamburger" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(9) "hamburger" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-07-07 20:56:44" ["post_modified_gmt"]=> string(19) "2017-07-07 18:56:44" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(57) "" ["menu_order"]=> int(0) ["post_type"]=> string(12) "specialities" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } ["error"]=> string(0) "" ["m"]=> string(0) "" ["p"]=> int(0) ["post_parent"]=> string(0) "" ["subpost"]=> string(0) "" ["subpost_id"]=> string(0) "" ["attachment"]=> string(0) "" ["attachment_id"]=> int(0) ["name"]=> string(0) "" ["static"]=> string(0) "" ["pagename"]=> string(0) "" ["page_id"]=> int(0) ["second"]=> string(0) "" ["minute"]=> string(0) "" ["hour"]=> string(0) "" ["day"]=> int(0) ["monthnum"]=> int(0) ["year"]=> int(0) ["w"]=> int(0) ["category_name"]=> string(0) "" ["tag"]=> string(0) "" ["cat"]=> string(0) "" ["tag_id"]=> string(0) "" ["author"]=> string(0) "" ["author_name"]=> string(0) "" ["feed"]=> string(0) "" ["tb"]=> string(0) "" ["paged"]=> int(0) ["meta_key"]=> string(0) "" ["meta_value"]=> string(0) "" ["preview"]=> string(0) "" ["s"]=> string(0) "" ["sentence"]=> string(0) "" ["title"]=> string(0) "" ["fields"]=> string(0) "" ["menu_order"]=> string(0) "" ["embed"]=> string(0) "" ["category__in"]=> array(0) { } ["category__not_in"]=> array(0) { } ["category__and"]=> array(0) { } ["post__in"]=> array(0) { } ["post__not_in"]=> array(0) { } ["post_name__in"]=> array(0) { } ["tag__in"]=> array(0) { } ["tag__not_in"]=> array(0) { } ["tag__and"]=> array(0) { } ["tag_slug__in"]=> array(0) { } ["tag_slug__and"]=> array(0) { } ["post_parent__in"]=> array(0) { } ["post_parent__not_in"]=> array(0) { } ["author__in"]=> array(0) { } ["author__not_in"]=> array(0) { } ["ignore_sticky_posts"]=> bool(false) ["suppress_filters"]=> bool(false) ["cache_results"]=> bool(true) ["update_post_term_cache"]=> bool(true) ["lazy_load_term_meta"]=> bool(true) ["update_post_meta_cache"]=> bool(true) ["post_type"]=> string(0) "" ["posts_per_page"]=> int(10) ["nopaging"]=> bool(false) ["comments_per_page"]=> string(2) "50" ["no_found_rows"]=> bool(false) ["order"]=> string(4) "DESC" } ["tax_query"]=> object(WP_Tax_Query)#7005 (6) { ["queries"]=> array(0) { } ["relation"]=> string(3) "AND" ["table_aliases":protected]=> array(0) { } ["queried_terms"]=> array(0) { } ["primary_table"]=> string(8) "wp_posts" ["primary_id_column"]=> string(2) "ID" } ["meta_query"]=> object(WP_Meta_Query)#7004 (9) { ["queries"]=> array(0) { } ["relation"]=> NULL ["meta_table"]=> NULL ["meta_id_column"]=> NULL ["primary_table"]=> NULL ["primary_id_column"]=> NULL ["table_aliases":protected]=> array(0) { } ["clauses":protected]=> array(0) { } ["has_or_relation":protected]=> bool(false) } ["date_query"]=> bool(false) ["request"]=> string(259) "SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 0, 10" ["posts"]=> array(0) { } ["post_count"]=> int(0) ["current_post"]=> int(-1) ["in_the_loop"]=> bool(false) ["comment_count"]=> int(0) ["current_comment"]=> int(-1) ["found_posts"]=> int(0) ["max_num_pages"]=> int(0) ["max_num_comment_pages"]=> int(0) ["is_single"]=> bool(false) ["is_preview"]=> bool(false) ["is_page"]=> bool(false) ["is_archive"]=> bool(false) ["is_date"]=> bool(false) ["is_year"]=> bool(false) ["is_month"]=> bool(false) ["is_day"]=> bool(false) ["is_time"]=> bool(false) ["is_author"]=> bool(false) ["is_category"]=> bool(false) ["is_tag"]=> bool(false) ["is_tax"]=> bool(false) ["is_search"]=> bool(false) ["is_feed"]=> bool(false) ["is_comment_feed"]=> bool(false) ["is_trackback"]=> bool(false) ["is_home"]=> bool(true) ["is_404"]=> bool(false) ["is_embed"]=> bool(false) ["is_paged"]=> bool(false) ["is_admin"]=> bool(false) ["is_attachment"]=> bool(false) ["is_singular"]=> bool(false) ["is_robots"]=> bool(false) ["is_posts_page"]=> bool(false) ["is_post_type_archive"]=> bool(false) ["query_vars_hash":"WP_Query":private]=> string(32) "efaea6907a432061160b874915d6ab95" ["query_vars_changed":"WP_Query":private]=> bool(false) ["thumbnails_cached"]=> bool(false) ["stopwords":"WP_Query":private]=> NULL ["compat_fields":"WP_Query":private]=> array(2) { [0]=> string(15) "query_vars_hash" [1]=> string(18) "query_vars_changed" } ["compat_methods":"WP_Query":private]=> array(2) { [0]=> string(16) "init_query_flags" [1]=> string(15) "parse_tax_query" } }

Body:
In your query you use two function query_posts() and WP_Query().

$args = query_posts( array(
        'post_type'  => 'specialities',
        'posts_per_page' => -1
    ));
$query = new WP_Query($args);

query_posts() and WP_Query() two are different functions.

You can use following code

$args = array(
    'post_type'  => 'specialities',
    'posts_per_page' => -1
);
$query = new WP_Query($args);

Ref.
- https://codex.wordpress.org/User:JamesVL/query_posts

-https://codex.wordpress.org/Class_Reference/WP_Query


问:
About mobile game porting
I would like to ask a few questions regarding mobile game porting...

Let say if I have a simple 2D C++ game engine and have a PC game based on that engine and I want to port it to different mobile platforms BREW, J2ME, iPhone, Android, Symbian, etc..

Do I need to re-code the engine and the game for each platform? or is there an easier and more efficient way? I am sure the process is complicated since different phones have different graphic/processor/memory/etc. I am just curious about the overview of mobile game porting process. :)

Thanks!

答:
There is no free lunch. The platforms you are considering are not compatible, most of then allow you to run C/C++ code so in theory you could port the engine to some Standard, such as ANSI, or C99 and it would compile in most of the platforms PC, BREW however this does not take in account the libraries your engine might need. For example if your engine uses OpenGL then it would work in the PC, and some consoles but on Symbiam devices you need OpenGL-ES which is not exactly the same, so you need an abstraction for all libraries you use.

About J2ME and Android they are Java platforms, so no C/C++ can be run there without any special VM lib at least. In this case you need to port the C/C++ code to Java which can be overkiling.

So my answer to this is while you can make an abstraction to your libs and code using standards you might be able to use the same engine in several platforms as long you can use the same compiler for them.

Take a look for example to this engine CubicVR it allows you to compile the same engine for PC/Linux/MAC/iPhone (maybe)/Sony PlayStation Portable

Title: About mobile game porting

OwnerDisplayName: Paulo Lopes


问:
Rails serialized JSON to string gives error on mysql JSON field
I have an old table which used to save json to a string sql field using the Rails ActiveRecord serializer. I created a new table with the field datatype as JSON which was introduced in MySQL 5.7. But directly copying the data from the old field to the new one gives me JSON error saying the json structure is wrong.

More specifically the problem is with unicode characters which my database does not support as of yet and the database is too large to just migrate everything to support it.

I am looking for a way to migrate the data from the old field to the new JSON field

I have seen that replacing \ufor the unicode character to \\u in the JSON string solved the issue but I am not just able to do this:

```<code>update table_name set column_name=REPLACE(column_name, '\u', '\\u');
</code>```

since it gives an error again

```<code>ERROR 3140 (22032): Invalid JSON text: "Invalid escape character in string." at position 564 in value for column 'table_name.column_name'.
</code>```

答:
for sql updating table values \u to \\u :</p>

```<code> update table_name set column_name=REPLACE(column_name, '\\u', '\\\\u') [where condition];
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I have an old table which used to save json to a string sql field using the Rails ActiveRecord serializer. I created a new table with the field datatype as JSON which was introduced in MySQL 5.7. But directly copying the data from the old field to the new one gives me JSON error saying the json structure is wrong.

More specifically the problem is with unicode characters which my database does not support as of yet and the database is too large to just migrate everything to support it.

I am looking for a way to migrate the data from the old field to the new JSON field

I have seen that replacing \ufor the unicode character to \\u in the JSON string solved the issue but I am not just able to do this:

update table_name set column_name=REPLACE(column_name, '\u', '\\u');

since it gives an error again

ERROR 3140 (22032): Invalid JSON text: "Invalid escape character in string." at position 564 in value for column 'table_name.column_name'.

Body:
for sql updating table values \u to \\u :

 update table_name set column_name=REPLACE(column_name, '\\u', '\\\\u') [where condition];


问:
Does select, input and label elements have height property?
The structure of my markup looks something like this:

```<code><div id="outerdiv">
    <div>
        Some text <select>...options...</select>
    </div>
    <div>
        <input><label><input><label>...
    </div>
    <div>
        Some text <select>...otions...</select>
    </div>
</div>
</code>```

The text is bold, the select tags have their default styling, and the label tags are styled as below and all take up space on the page. (The input has display:none.) However unless the #outerdiv is explicitly given a height, it collapses; if a 1px border is applied, it makes a straight horizontal line from which the other styled elements appear to "hang."

Why is this / what is happening here?

Edit: All the inner divs are floated left, and the labels are styled as such:

```<code>.CheckLabels{
    display: inline-block;
    width: 7%;
    height: 45px;
}
</code>```

No other relevant styles are applied as far as I can tell.

答:
Does select, input and label elements have height property?

To declare 'height', the element has to be either display: "block" or "inline-block" -

```<code>.thing {
  display: block; /* or */
  display: inline-block;
  height: 20px; /* 95% of the time.. you should NOT declare a height */
  /* but this will work */
}
</code>```

(real question)

Why does my parent Element collapse when I float it's children?

When you 'float' elements, it takes them out of the traditional flow - and so you have to use a "clear-fix." What is a clearfix?

You can also use overflow: hidden; or a border to trick it back into order. Overflow hidden used to have some side-effects... but I don't think that's a concern these days...

.parent {
  background: lightgreen;
  overflow: hidden; /* but really - you should use a clearfix */
}

.parent div {
  width: 100%;
  float: left;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><section class="parent">
  <div>
    Some text
    <select>
      <option value="1">One</option>
      <option value="2">Two</option>
    </select>
  </div>

  <div>
    <label for="thing-1">Input label</label>
    <input type="text" id="thing-1">
  </div>

  <div>
    Some text
    <select>
      <option value="1">One</option>
      <option value="2">Two</option>
    </select>
  </div>
</section></code>```

Body:
The structure of my markup looks something like this:

        Some text <select>...options...</select>

        <input><input>...

        Some text <select>...otions...</select>

The text is bold, the select tags have their default styling, and the label tags are styled as below and all take up space on the page. (The input has display:none.) However unless the #outerdiv is explicitly given a height, it collapses; if a 1px border is applied, it makes a straight horizontal line from which the other styled elements appear to "hang."

Why is this / what is happening here?

Edit: All the inner divs are floated left, and the labels are styled as such:

.CheckLabels{
    display: inline-block;
    width: 7%;
    height: 45px;
}

No other relevant styles are applied as far as I can tell.

Body:
Does select, input and label elements have height property?

To declare 'height', the element has to be either display: "block" or "inline-block" -

.thing {
  display: block; /* or */
  display: inline-block;
  height: 20px; /* 95% of the time.. you should NOT declare a height */
  /* but this will work */
}

(real question)

Why does my parent Element collapse when I float it's children?

When you 'float' elements, it takes them out of the traditional flow - and so you have to use a "clear-fix." What is a clearfix?

You can also use overflow: hidden; or a border to trick it back into order. Overflow hidden used to have some side-effects... but I don't think that's a concern these days...

.parent {
  background: lightgreen;
  overflow: hidden; /* but really - you should use a clearfix */
}

.parent div {
  width: 100%;
  float: left;
}

<section class="parent">
  <div>
    Some text
    <select>
      <option value="1">One</option>
      <option value="2">Two</option>
    </select>
  </div>

  <div>
    <label for="thing-1">Input label</label>
    <input type="text" id="thing-1">
  </div>

  <div>
    Some text
    <select>
      <option value="1">One</option>
      <option value="2">Two</option>
    </select>
  </div>
</section>


问:
How to instruct Spring to Autowire a field in a chain of tightly coupled objects
It's kinda hard to explain... Hope the question isn't vague...

you can look at the code to get the idea...

ClassA.java

```<code>public class ClassA {
    @Autowired
    InterA abcd;
    public void dododo() {
        abcd.doit();
    }
}
</code>```

ClassB.java

```<code>@Component
public class ClassB implements InterA {
    @Override
    public void doit() {
        System.out.println("hoo hoo");
    }
}
</code>```

ClassC.java

```<code>@Component("classc")
public class ClassC {
    public void doFromAbove() {
        ClassA cls = new ClassA();
        cls.dododo();
    }
}
</code>```

Interface InterA.java

```<code>public interface InterA {
    public void doit();
}
</code>```

Configuration ClassConfig.java (on the same package of other java class files)

```<code>@Configuration
@ComponentScan
public class ClassConfig {
}
</code>```

Main Method

```<code>public static void main(String[] args) {
    try(AbstractApplicationContext appctx = new AnnotationConfigApplicationContext(ClassConfig.class)) {
        ClassC obj = (ClassC) appctx.getBean("classc");
        obj.doFromAbove();
    }
}
</code>```

When I execute the main method, the Autowired field "abcd" in ClassA didn't get injected and results in a NullPointerException

It works only when I declare ClassA as a @Component and get it's bean... indirect autowiring is not happening

Should I decouple ClassA from ClassC and make everything loosely coupled?

Is there any simple annotation that I can use to tell Spring auto inject the @Autowired field even when the object is created in a tight coupled fashion?

Note
please don't tell me to use ApplicationContext in ClassC to create the bean of ClassA .

Any Spring Geek who could find an answer?

答:
You could use @Configurable if you enable load time weaving and that would make each new instance of the object a managed spring component, so the new statement you used will work.

Besides this you could create a prototype scoped bean definition and a factory bean that would reference that bean, meaning it will give you a new bean each time, so you would inject the factory and only call the get method for a new instance.

Body:
It's kinda hard to explain... Hope the question isn't vague...

you can look at the code to get the idea...

ClassA.java

public class ClassA {
    @Autowired
    InterA abcd;
    public void dododo() {
        abcd.doit();
    }
}

ClassB.java

@Component
public class ClassB implements InterA {
    @Override
    public void doit() {
        System.out.println("hoo hoo");
    }
}

ClassC.java

@Component("classc")
public class ClassC {
    public void doFromAbove() {
        ClassA cls = new ClassA();
        cls.dododo();
    }
}

Interface InterA.java

public interface InterA {
    public void doit();
}

Configuration ClassConfig.java (on the same package of other java class files)

@Configuration
@ComponentScan
public class ClassConfig {
}

Main Method

public static void main(String[] args) {
    try(AbstractApplicationContext appctx = new AnnotationConfigApplicationContext(ClassConfig.class)) {
        ClassC obj = (ClassC) appctx.getBean("classc");
        obj.doFromAbove();
    }
}

When I execute the main method, the Autowired field "abcd" in ClassA didn't get injected and results in a NullPointerException

It works only when I declare ClassA as a @Component and get it's bean... indirect autowiring is not happening

Should I decouple ClassA from ClassC and make everything loosely coupled?

Is there any simple annotation that I can use to tell Spring auto inject the @Autowired field even when the object is created in a tight coupled fashion?

Note
please don't tell me to use ApplicationContext in ClassC to create the bean of ClassA .

Any Spring Geek who could find an answer?


问:
Line continuation with pgfortran
I am trying to compile a file with pgf90 or pgfortran(that can handle all kinds of source files i.e. f90 or f77) that is written with fortran 77 constructs(i.e. has a .f extension). The question I have  is with line continuation.

```<code>open(10,file='/home/adaba/original/potentialenergy/vorticity/data/run/fort.10')
</code>```

So this line clearly goes beyond column 72. Here is what I tried. I tried breaking this up into two lines by using the '&' character at column 6 in the new line and compiled it. It compiles fine but when I run the program I get an error saying no such file found because it interprets the line continuation as an extra space between run and fort.10 and it reports file not found.

So I kept the code in one line and then added -Mextend which is pgi specific instruction for line extension. Now it seems to add some weird characters to the end of another file name much later in a subroutine. It does open fort.10 properly but it fails to open another file much later in the code and adds some weird characters to end of that file(in binary). In Emacs which is my editor I can see only purple color after the fort.10 statement (indicating that something is not right).

Can somebody with pgi fortran experience help ?

UPDATE

```<code>open(10,file='/home/adabas/originalPV/potentialenergy/vorticity/' // &
 &     'data/run/fort.10')
</code>```

I get a pgf90-s-0034 syntax error at or near &(on the upper line)

The pgf version is 17.0.4 64 bit

答:
Off the top of my head, there's a couple things I would try first.

You can request the compiler to allow fixed format (.f) files to be longer than 72 characters. In PGI this is done with the -Mextend compiler flag.

Alternatively, you should be able to construct the filename by splitting it in two lines. Something like:

```<code> open(10,file='/home/adaba/original/' //
& 'potentialenergy/vorticity/data/run/fort.10')
</code>```

where // is the operator to combine strings. There's other ways to do this, too - you could define a character string as fname first, for example.

Title: Line continuation with pgfortran

Body:
I am trying to compile a file with pgf90 or pgfortran(that can handle all kinds of source files i.e. f90 or f77) that is written with fortran 77 constructs(i.e. has a .f extension). The question I have  is with line continuation.

open(10,file='/home/adaba/original/potentialenergy/vorticity/data/run/fort.10')

So this line clearly goes beyond column 72. Here is what I tried. I tried breaking this up into two lines by using the '&' character at column 6 in the new line and compiled it. It compiles fine but when I run the program I get an error saying no such file found because it interprets the line continuation as an extra space between run and fort.10 and it reports file not found.

So I kept the code in one line and then added -Mextend which is pgi specific instruction for line extension. Now it seems to add some weird characters to the end of another file name much later in a subroutine. It does open fort.10 properly but it fails to open another file much later in the code and adds some weird characters to end of that file(in binary). In Emacs which is my editor I can see only purple color after the fort.10 statement (indicating that something is not right).

Can somebody with pgi fortran experience help ?

UPDATE

open(10,file='/home/adabas/originalPV/potentialenergy/vorticity/' // &
 &     'data/run/fort.10')

I get a pgf90-s-0034 syntax error at or near &(on the upper line)

The pgf version is 17.0.4 64 bit

Body:
Off the top of my head, there's a couple things I would try first.

You can request the compiler to allow fixed format (.f) files to be longer than 72 characters. In PGI this is done with the -Mextend compiler flag.

Alternatively, you should be able to construct the filename by splitting it in two lines. Something like:

 open(10,file='/home/adaba/original/' //
& 'potentialenergy/vorticity/data/run/fort.10')

where // is the operator to combine strings. There's other ways to do this, too - you could define a character string as fname first, for example.


问:
derive data calculation
I want use derived data to get the total salary calculated based on the appointment handled (20 pounds for each) and the basic salary is 1000 pound. Also, the salary should be ordered by the month and year.

The appointment table have appointment date and time, Worker table have WorkerID and WorkerName and the salary have the salaryID, appointmenthandled and appointment cost (20 pounds).
I want to calculate the total salary based on basic salary 1000 pound each month and other cost (appointmenthandled * 20) order by date.
I have problem with ordering by date.

Appointment table

```<code>AppointmenID |AppointmentDate  | MechanicID
:----- | -----:     | :----:
AI1   | 2017-01-01  | MI1
AI2   | 2017-01-15  | MI2
AI3   | 2017-02-01  | MI1
</code>```

Salary table

```<code>SalaryID | Salary  | AppointmentCost
:----- | -----:     | :----:
1      | 1000       | 20
</code>```

Appointment table

```<code>AppointmenID |AppointmentDate  | MechanicID
:----- | -----:     | :----:
AI1   | 2017-01-01  | MI1
AI2   | 2017-01-15  | MI2
AI3   | 2017-02-01  | MI1
AI4   | 2017-01-25  | MI2
</code>```

Mechanic table

```<code>MechanicID |MechanicName| SalaryID
:----- | -----:     | :----:
MI1   | Rooney      | 1
MI2   | Stephan     | 1
MI3   | Ronaldo     | 1
</code>```

EXPECTED OUTPUT

salary of January

```<code>AppointmentDate  | MechanicID | MechanicName | Salary| AppointmentCost| Appointment Handled | Salary
:----- |      -----: | :----:   | ----:| :----:|:--|:-----|
2017-01-01  | MI1    | Rooney   | 1000   | 20    |1  | 1020
2017-01-15  | MI2    | Stephan  | 1000   | 20    |2  | 1040
</code>```

salary of February

```<code>AppointmentDate  | MechanicID | MechanicName | Salary| AppointmentCost| Appointment Handled | Salary
:-----      | -----:     | :----:  |:----- | -----:| :----:  |:-----
2017-01-01  | MI1  |      Rooney   | MI1   | 1000  | 20      |1      | 1020
</code>```

Can anyone help me.

答:
You need Join's and following expression to calculate salary of mechanic

```<code>salary + ( count of appointmenthandled * appointmentcost )
</code>```

Something like this

```<code>SELECT A.appointmentdate,
       M.mechanicid,
       M.mechanicname,
       S.salary,
       S.appointmentcost,
       A.appointmenthandled,
       salary = S.salary + ( A.appointmenthandled * S.appointmentcost )
FROM   mechanic M
       INNER JOIN salary S
               ON M.salaryid = S.salaryid
       INNER JOIN (SELECT mechanicid,
                          AppointmentHandled = Count(*),
                          AppointmentDate =Min(appointmentdate)
                   FROM   appointment A
                   --Where month(AppointmentDate) = 1
                   GROUP  BY mechanicid,
                             Month(appointmentdate)) A
               ON M.mechanicid = A.mechanicid
</code>```

Title: derive data calculation

Body:
I want use derived data to get the total salary calculated based on the appointment handled (20 pounds for each) and the basic salary is 1000 pound. Also, the salary should be ordered by the month and year.

The appointment table have appointment date and time, Worker table have WorkerID and WorkerName and the salary have the salaryID, appointmenthandled and appointment cost (20 pounds).
I want to calculate the total salary based on basic salary 1000 pound each month and other cost (appointmenthandled * 20) order by date.
I have problem with ordering by date.

Appointment table

AppointmenID |AppointmentDate  | MechanicID
:----- | -----:     | :----:
AI1   | 2017-01-01  | MI1
AI2   | 2017-01-15  | MI2
AI3   | 2017-02-01  | MI1

Salary table

SalaryID | Salary  | AppointmentCost
:----- | -----:     | :----:
1      | 1000       | 20

Appointment table

AppointmenID |AppointmentDate  | MechanicID
:----- | -----:     | :----:
AI1   | 2017-01-01  | MI1
AI2   | 2017-01-15  | MI2
AI3   | 2017-02-01  | MI1
AI4   | 2017-01-25  | MI2

Mechanic table

MechanicID |MechanicName| SalaryID
:----- | -----:     | :----:
MI1   | Rooney      | 1
MI2   | Stephan     | 1
MI3   | Ronaldo     | 1

EXPECTED OUTPUT

salary of January

AppointmentDate  | MechanicID | MechanicName | Salary| AppointmentCost| Appointment Handled | Salary
:----- |      -----: | :----:   | ----:| :----:|:--|:-----|
2017-01-01  | MI1    | Rooney   | 1000   | 20    |1  | 1020
2017-01-15  | MI2    | Stephan  | 1000   | 20    |2  | 1040

salary of February

AppointmentDate  | MechanicID | MechanicName | Salary| AppointmentCost| Appointment Handled | Salary
:-----      | -----:     | :----:  |:----- | -----:| :----:  |:-----
2017-01-01  | MI1  |      Rooney   | MI1   | 1000  | 20      |1      | 1020

Can anyone help me.

Body:
You need Join's and following expression to calculate salary of mechanic

salary + ( count of appointmenthandled * appointmentcost )

Something like this

SELECT A.appointmentdate,
       M.mechanicid,
       M.mechanicname,
       S.salary,
       S.appointmentcost,
       A.appointmenthandled,
       salary = S.salary + ( A.appointmenthandled * S.appointmentcost )
FROM   mechanic M
       INNER JOIN salary S
               ON M.salaryid = S.salaryid
       INNER JOIN (SELECT mechanicid,
                          AppointmentHandled = Count(*),
                          AppointmentDate =Min(appointmentdate)
                   FROM   appointment A
                   --Where month(AppointmentDate) = 1
                   GROUP  BY mechanicid,
                             Month(appointmentdate)) A
               ON M.mechanicid = A.mechanicid


问:
How to use inner query to fetch data from salesforce to mule?
I wrote below query to fetch data from salesforce but getting error like "Unknown error parsing query"

```<code>select Email,Id from contact where Email in (select b.Email from contact as b group by b.Email having count(b.id) < 2 limit 1000)
</code>```

inner query alone retrieving the set of mail Ids, please suggest.

答:
You can first check your query on Salesforce using developer console if its working or not.

If its returning required result in Salesforce then it will work in Mulesoft as well.

Body:
I wrote below query to fetch data from salesforce but getting error like "Unknown error parsing query"

select Email,Id from contact where Email in (select b.Email from contact as b group by b.Email having count(b.id) < 2 limit 1000)

inner query alone retrieving the set of mail Ids, please suggest.


问:
passing variable to jquery click function
Hi I need to pass the  id variable from the following hyperlink to a jquery click function

Here is the link

```<code><a id='howdy' href='#' course_id = 5>Howdy</a>
</code>```

And here is the click function that I attempted to utilize:

```<code>$('a#howdy').click(function(e){
  $.get('insert_courses.php' + data.course_id, function(data){
    modal.open({content: data});
  });
});
</code>```

I need the correct syntax to put in place of

```<code>+ data.course_id
</code>```

as this doesn't seem to work thanks

答:
Change the current code to

```<code>$('a#howdy').click(function(e){
    $.get('insert_courses.php?id=' + $(this).attr("course_id"), function(data){
    modal.open({content: data});
    });
});
</code>```

Here you go with jsfiddle https://jsfiddle.net/4asa95cw/1/

Body:
Hi I need to pass the  id variable from the following hyperlink to a jquery click function

Here is the link

Howdy

And here is the click function that I attempted to utilize:

$('a#howdy').click(function(e){
  $.get('insert_courses.php' + data.course_id, function(data){
    modal.open({content: data});
  });
});

I need the correct syntax to put in place of

+ data.course_id

as this doesn't seem to work thanks

Body:
Change the current code to

$('a#howdy').click(function(e){
    $.get('insert_courses.php?id=' + $(this).attr("course_id"), function(data){
    modal.open({content: data});
    });
});

Here you go with jsfiddle https://jsfiddle.net/4asa95cw/1/


问:
Scope of variable with out parameter
Example:

I have the following code block:

```<code>if (!int.TryParse("123", out var parsedNumber))
{
    return;
}

Console.WriteLine(parsedNumber);
</code>```

The output in console is: 123

Question:

How is it possible, that the line Console.WriteLine(parsedNumber); knows about parsedNumber?

According to my understanding, parsedNumber should only available in the if-block, shouldn't it?

If I try this:

```<code>foreach (var data in dataList)
{
   data += "something";
}

Console.WriteLine(data);
</code>```

Console.WriteLine(data); can't find data.

I think, that the solution is the out parameter, but I'm not sure. Can someone explain this?

答:
Prior to C# 7.0

the out keyword was used to pass a method argument's reference. Before a variable is passed as an out argument, it must be declared.

```<code>var parsedNumber;
if (!int.TryParse("123", out var parsedNumber))
{
    return;
}

Console.WriteLine(parsedNumber);
</code>```

In C# 7.0

you can define a method's out parameters directly in the method. The new code looks like

```<code>if (!int.TryParse("123", out var parsedNumber))
{
    return;
}

Console.WriteLine(parsedNumber);
</code>```

Reference :

Whats-new-in-csharp-7-0

Title: Scope of variable with out parameter

Body:
Example:

I have the following code block:

if (!int.TryParse("123", out var parsedNumber))
{
    return;
}

Console.WriteLine(parsedNumber);

The output in console is: 123

Question:

How is it possible, that the line Console.WriteLine(parsedNumber); knows about parsedNumber?

According to my understanding, parsedNumber should only available in the if-block, shouldn't it?

If I try this:

foreach (var data in dataList)
{
   data += "something";
}

Console.WriteLine(data);

Console.WriteLine(data); can't find data.

I think, that the solution is the out parameter, but I'm not sure. Can someone explain this?

Body:
Prior to C# 7.0

the out keyword was used to pass a method argument's reference. Before a variable is passed as an out argument, it must be declared.

var parsedNumber;
if (!int.TryParse("123", out var parsedNumber))
{
    return;
}

Console.WriteLine(parsedNumber);

In C# 7.0

you can define a method's out parameters directly in the method. The new code looks like

if (!int.TryParse("123", out var parsedNumber))
{
    return;
}

Console.WriteLine(parsedNumber);

Reference :

Whats-new-in-csharp-7-0


问:
Server side rendering using Angular4(Angular Universal)
I am working on an Angular4 webpack project to which I wanted to add AngularUniversal to make server side rendering possible.But most tutorials are using angular cli.I want to integrate Universal with webpack.I tried following this tutorial with no luck.Can someone please help.</p>

答:
Angular universal is only used for angular 2.x. Angular 4.x you need to use platform server.Examples are as follows:

For angular 2.X.X :

AngularClass's seed project using express/universal

https://github.com/angular/universal-starter

For  angular 4.X.X
Use  angular platform server

https://github.com/ng-seed/universal

There are few other examples also:

https://github.com/hs950559/ng4-univ

https://github.com/designcourse/angular-seo learn step by step implementation here


问:
Code wont exit out of while loop
Attempting to create my first program Expected behaviour:

```<code>1. User inputs an integer (lets say 7)
2. User continues to input same integer more times (lets say 4 total)
3. User inputs 8
4. Program then prints ("the count of 7 was 4")
5. User continues to enter 8 (lets say a 8 was entered a total of 11 times)
6. User enters 73
7. Program then prints ("the count of 8 was 11")
</code>```

After step 4, the program gets stuck and any inputs yeild "7 was entered 0 times"

```<code>#include <iostream>

int main(){

    int inputtedvalue = 0;
    int firstvalue = 0;
    int cnt = 0;

    if(std::cin >> firstvalue){
        ++cnt;
        while(std::cin >> inputtedvalue){
            if(inputtedvalue == firstvalue)
                ++cnt;
            else{

                std::cout << "the count of " << firstvalue <<" is " << cnt << std::endl;
                inputtedvalue = firstvalue;
                cnt= 1;
            }
        }
    }
}
</code>```

答:
I was looking over your example, and i believe the following might get you back in the right direction. </p>

```<code>using namespace std;

int main(){

int inputtedvalue = 0;
int firstvalue = 0;
int cnt = 0;

cout << "Enter Starting value."<< std::endl;
if (cin >> firstvalue){

    cout << "New count " << firstvalue <<" of " << cnt << endl;
    while(cin >> inputtedvalue)
    {
        if(inputtedvalue != firstvalue)
        {
            cout << "It Doesn't Match" << endl;
            firstvalue = inputtedvalue;
        }
        else
        {
            cout << "It Matches" << endl;

        }
    }
}
</code>```

Title: Code wont exit out of while loop

Body:
Attempting to create my first program Expected behaviour:

1. User inputs an integer (lets say 7)
2. User continues to input same integer more times (lets say 4 total)
3. User inputs 8
4. Program then prints ("the count of 7 was 4")
5. User continues to enter 8 (lets say a 8 was entered a total of 11 times)
6. User enters 73
7. Program then prints ("the count of 8 was 11")

After step 4, the program gets stuck and any inputs yeild "7 was entered 0 times"

#include <iostream>

int main(){

    int inputtedvalue = 0;
    int firstvalue = 0;
    int cnt = 0;

    if(std::cin >> firstvalue){
        ++cnt;
        while(std::cin >> inputtedvalue){
            if(inputtedvalue == firstvalue)
                ++cnt;
            else{

                std::cout << "the count of " << firstvalue <<" is " << cnt << std::endl;
                inputtedvalue = firstvalue;
                cnt= 1;
            }
        }
    }
}

Body:
I was looking over your example, and i believe the following might get you back in the right direction.

using namespace std;

int main(){

int inputtedvalue = 0;
int firstvalue = 0;
int cnt = 0;

cout << "Enter Starting value."<< std::endl;
if (cin >> firstvalue){

    cout << "New count " << firstvalue <<" of " << cnt << endl;
    while(cin >> inputtedvalue)
    {
        if(inputtedvalue != firstvalue)
        {
            cout << "It Doesn't Match" << endl;
            firstvalue = inputtedvalue;
        }
        else
        {
            cout << "It Matches" << endl;

        }
    }
}


答:
You simply need to access the course-id attribute if the element.

```<code> <a id='howdy' href='#' course_id = 5>Howdy</a>

     $('a#howdy').click(function(e){
            $.get('insert_courses.php' + $('#howdy).attr('course-id'), function(data){
            modal.open({content: data});
            });
     });
</code>```

Title: passing variable to jquery click function

Body:
You simply need to access the course-id attribute if the element.

 <a id='howdy' href='#' course_id = 5>Howdy</a>

     $('a#howdy').click(function(e){
            $.get('insert_courses.php' + $('#howdy).attr('course-id'), function(data){
            modal.open({content: data});
            });
     });


问:
How to prevent multiple child viewControllers from loading at once?
I have a Container viewController with 3 Child viewControllers.

When the app first launches all 3 Child viewControllers gets loaded instead of me first swiping to the View controller. This is causing me issues when my analytics tool tracks what screen the user is on/loaded. How can I prevent this form happening?

答:
You should embed your initial child view controller in your container view, instead of loading all Child View Controller. Its better to add/ remove child view controller when required, instead of loading all child view controller at initial stage.

Hold the Ctrl key and drag with the mouse from the container view to the child view controller. Now add an embed segue.

Instead of playing with alpha values of all child view controller its advisable to add / remove required  view controller in container view. You can consult this link for more info.This links explains healthy ways to employ container view.

Hope it helps. Happy Coding!!