问:
How to configure dynamic routes with express.js
I have a route.js which looks like this:

```<code>module.exports = function(app) {

  app.get('/tip', function(req, res) {
    res.render("tip");
  });

  app.get('/article', function(req, res) {
   res.render("article");
  });

  app.get('/article1', function(req, res) {
   res.render("article1");
  });

  app.get('/article2', function(req, res) {
   res.render("article2");
  });

  app.get('/article3', function(req, res) {
   res.render("article3");
  });

  app.get('/modules/:name', function(req, res) {
    var name = req.params.name;
    res.render('modules/' + name);
  });

  app.get('/modules/esaver/:name', function(req, res) {
    var name = req.params.name;
    res.render('modules/esaver/' + name);
  });

};
</code>```

Considering i have over 200 different routes to create, i would end up with stuff like 'article1', 'article2' etc

and my app.js is like:

```<code>var express = require('express')
  ,http = require('http')
  ,fs = require('fs')
  ,path = require('path');

var app = express();

html_templates = __dirname + '/html_templates';

app.set('views', html_templates + '/views');
app.set('view engine', 'jade');

app.use('/Core', express.static(__dirname + '/Core'));

app.listen(3000, function () {
 console.log("express has started on port 3000");
});

require('./html_templates/controller/routes.js')(app);
</code>```

Is there any dynamic way to create this?

答:
I create a new module called: jadewalker. It will create router code automatically.

We can simply add a jadewalker comment to your jade Or pug file.

```<code>//- jadewalker=/b,/b/:id
doctype html
html
 title b.jade
body
  p b.jade
  p params: #{params.id}
</code>```

And add this module to our app. That's all.

```<code>var app = require('koa')()
var router = require('koa-router')();
router = require('jadewalker')(router, path.join(__dirname, 'views'));
app.use(router.routes());
</code>```

We can visit our jade file by the URL http://localhost:3000/b/abc. （＾∀＾）

Body:
I have a route.js which looks like this:

module.exports = function(app) {

  app.get('/tip', function(req, res) {
    res.render("tip");
  });

  app.get('/article', function(req, res) {
   res.render("article");
  });

  app.get('/article1', function(req, res) {
   res.render("article1");
  });

  app.get('/article2', function(req, res) {
   res.render("article2");
  });

  app.get('/article3', function(req, res) {
   res.render("article3");
  });

  app.get('/modules/:name', function(req, res) {
    var name = req.params.name;
    res.render('modules/' + name);
  });

  app.get('/modules/esaver/:name', function(req, res) {
    var name = req.params.name;
    res.render('modules/esaver/' + name);
  });

};

Considering i have over 200 different routes to create, i would end up with stuff like 'article1', 'article2' etc

and my app.js is like:

var express = require('express')
  ,http = require('http')
  ,fs = require('fs')
  ,path = require('path');

var app = express();

html_templates = __dirname + '/html_templates';

app.set('views', html_templates + '/views');
app.set('view engine', 'jade');

app.use('/Core', express.static(__dirname + '/Core'));

app.listen(3000, function () {
 console.log("express has started on port 3000");
});

require('./html_templates/controller/routes.js')(app);

Is there any dynamic way to create this?

Body:
I create a new module called: jadewalker. It will create router code automatically.

We can simply add a jadewalker comment to your jade Or pug file.

//- jadewalker=/b,/b/:id
doctype html
html
 title b.jade
body
  p b.jade
  p params: #{params.id}

And add this module to our app. That's all.

var app = require('koa')()
var router = require('koa-router')();
router = require('jadewalker')(router, path.join(__dirname, 'views'));
app.use(router.routes());

We can visit our jade file by the URL http://localhost:3000/b/abc. （＾∀＾）


来源: stackexchange

问:
how to make the last div column stay on the top of the page in mobile view?
I divided my divs into 4 columns, in the first column there is a previous page button arrow, in second and third columns contain the content and the last column contains the next page button arrow. But in the mobile view the last column arrow is at the bottom of the page, i need it to be placed on the top near to the previous button arrow.

```<code><div class="container">
                <div class="row">
                    <div class="col-md-1">
                        <form>
                            <input type="button" class="default_previous sprite" alt="Submit">
                        </form>

                    </div>

                    <div class="col-md-4">
                        <div class="container-two-grid">

                            <div class="grid-two imageandtext">
                                <figure>
                                   <div class="imageandtext image_grid">
                                   <label for="selimg1">
                                    <img src="assets/images/painting.jpg" class="img-thumbnail">
                                    </label>
                                     <input type="radio" name="selimg" id="selimg1">
                                    <div class="caption">
                                        <p>Painting</p>
                                    </div>
                                    </div>
                                    <div class="imageandtext image_grid">
                                    <label for="selimg2">
                                        <img src="assets/images/photography.jpg" class="img-thumbnail" >
                                        </label>
                                        <input type="radio" name="selimg" id="selimg2">
                                        <div class="caption">
                                            <p>Photography</p>
                                        </div></div>
                                    </figure>
                                </div>

                                <div class="grid-two imageandtext">
                                <figure>
                                   <div class="imageandtext image_grid">
                                   <label for="selimg3">
                                    <img src="assets/images/drawing.jpg" class="img-thumbnail">
                                    </label>
                                     <input type="radio" name="selimg" id="selimg3">
                                    <div class="caption">
                                        <p>Drawing</p>
                                    </div>
                                    </div>
                                    <div class="imageandtext image_grid">
                                    <label for="selimg4">
                                        <img src="assets/images/sculpture.jpg" class="img-thumbnail" >
                                        </label>
                                        <input type="radio" name="selimg" id="selimg4">
                                        <div class="caption">
                                            <p>Sculpture</p>
                                        </div></div>
                                    </figure>
                                </div>

                                <div class="grid-two imageandtext">
                                <figure>
                                   <div class="imageandtext image_grid">
                                   <label for="selimg5">
                                    <img src="assets/images/painting.jpg" class="img-thumbnail">
                                    </label>
                                     <input type="radio" name="selimg" id="selimg5">
                                    <div class="caption">
                                        <p>Painting</p>
                                    </div>
                                    </div>
                                    <div class="imageandtext image_grid">
                                    <label for="selimg6">
                                        <img src="assets/images/photography.jpg" class="img-thumbnail" >
                                        </label>
                                        <input type="radio" name="selimg" id="selimg6">
                                        <div class="caption">
                                            <p>Photography</p>
                                        </div></div>
                                    </figure>
                                </div>
                               <div class="grid-two imageandtext">
                                <figure>
                                   <div class="imageandtext image_grid">
                                   <label for="selimg7">
                                    <img src="assets/images/drawing.jpg" class="img-thumbnail">
                                    </label>
                                     <input type="radio" name="selimg" id="selimg7">
                                    <div class="caption">
                                        <p>Drawing</p>
                                    </div>
                                    </div>
                                    <div class="imageandtext image_grid">
                                    <label for="selimg8">
                                        <img src="assets/images/sculpture.jpg" class="img-thumbnail" >
                                        </label>
                                        <input type="radio" name="selimg" id="selimg8">
                                        <div class="caption">
                                            <p>Sculpture</p>
                                        </div></div>
                                    </figure>
                                </div>

                            </div>

                        </div>
                        <div class="col-md-6">
                            <div class="container-form-grid">
                                <div class="subject_art">
                                    <form>
                                        <select class="mdb-select">
                                            <option value="" disabled selected>Subject of ART</option>
                                            <option value="1">Option 1</option>
                                            <option value="2">Option 2</option>
                                            <option value="3">Option 3</option>
                                        </select>
                                    </form>
                                </div>

                                <form class="form-inline">

                                    <h4>Dimensions</h4>
                                    <select class="mdb-select">
                                        <option value="" disabled selected>Units</option>
                                        <option value="1">Option 1</option>
                                        <option value="2">Option 2</option>
                                        <option value="3">Option 3</option>
                                    </select>

                                </form>
                                <form class="form-inline">

                                    <div class="md-form form-group">

                                        <input type="text" id="form1" class="form-control">
                                        <label for="form1" class="">Width</label>
                                    </div>

                                    <div class="md-form form-group">
                                        <input type="text" id="form1" class="form-control">
                                        <label for="form1" class="">Height</label>
                                    </div>

                                    <div class="md-form form-group">
                                        <input type="text" id="form1" class="form-control">
                                        <label for="form1" class="">Depth</label>
                                    </div>

                                </form>
                                <form>
                                    <div class="form_weight">
                                        <div class="md-form">
                                            <input type="text" id="form41" class="form-control">
                                            <label for="form41" class="">Weight</label>
                                        </div>
                                    </div>

                                </form>
                                <form class="form-inline">
                                <h4>ART Specifics</h4>
                                    <div class="form_row">
                                        <ul>
                                            <li>
                                                <select class="mdb-select">
                                                    <option value="" disabled selected>Medium</option>
                                                    <option value="1">Option 1</option>
                                                    <option value="2">Option 2</option>
                                                    <option value="3">Option 3</option>
                                                </select>
                                            </li>
                                            <li>
                                                <select class="mdb-select">
                                                    <option value="" disabled selected>Material</option>
                                                    <option value="1">Option 1</option>
                                                    <option value="2">Option 2</option>
                                                    <option value="3">Option 3</option>
                                                </select>
                                            </li>
                                            <li><select class="mdb-select">
                                                <option value="" disabled selected>Styles</option>
                                                <option value="1">Option 1</option>
                                                <option value="2">Option 2</option>
                                                <option value="3">Option 3</option>
                                            </select></li>
                                        </ul>
                                    </div>

                                </form>
                                <form>
                                    <div class="md-form form-width">
                                        <input type="text" id="form1" class="form-control">
                                        <label for="form1" class="">Keywords/Tags (Type 5 to 20 items)  </label>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="col-md-1">
                            <form>
                                <input type="button" class="default-next sprite" alt="Submit">

                            </form>
                        </div>
                    </div>
                </section>
</code>```

css(previous button and next button)

```<code>.uploadart_content .default-next{
      width: 83px;
      height: 65px;
      margin-right: 8px;
      display: inline-block;
      vertical-align: middle;
      background-position: -71px -235px;
      margin-top: 341px;
      border:none;
      outline: none;

    }
    .uploadart_content .default_previous{
      width: 83px;
      height: 65px;
      margin-right: 8px;
      display: inline-block;
      vertical-align: middle;
      background-position: -139px -235px;
      margin-top: 341px;
      border:none;
      outline: none;
    }
</code>```

答:
you can do that in css using the media property for mobile width:

```<code>@media all and (max-width:767px){
    .row{
        position: relative;
        padding-top:30px;//the height of your arrows
    }
    .row .col-md-1{
        position: absolute;
        top: 0;
    }
    .row .col-md-1:first-child{
        left:0;
    }
    .row .col-md-1:last-child{
        right:0;
    }
}
</code>```

Alternatively you can stop to use bootstrap float left and start the use of display:flex. You can use order property to prepend the last child in the second place

ContentLicense: CC BY-SA 3.0

Body:
I divided my divs into 4 columns, in the first column there is a previous page button arrow, in second and third columns contain the content and the last column contains the next page button arrow. But in the mobile view the last column arrow is at the bottom of the page, i need it to be placed on the top near to the previous button arrow.

                        <form>
                            <input type="button" class="default_previous sprite" alt="Submit">
                        </form>

                                     <input type="radio" name="selimg" id="selimg1">

Painting

                                        <input type="radio" name="selimg" id="selimg2">

Photography

                                     <input type="radio" name="selimg" id="selimg3">

Drawing

                                        <input type="radio" name="selimg" id="selimg4">

Sculpture

                                     <input type="radio" name="selimg" id="selimg5">

Painting

                                        <input type="radio" name="selimg" id="selimg6">

Photography

                                     <input type="radio" name="selimg" id="selimg7">

Drawing

                                        <input type="radio" name="selimg" id="selimg8">

Sculpture

                                    <form>
                                        <select class="mdb-select">
                                            <option value="" disabled selected>Subject of ART</option>
                                            <option value="1">Option 1</option>
                                            <option value="2">Option 2</option>
                                            <option value="3">Option 3</option>
                                        </select>
                                    </form>

                                <form class="form-inline">

Dimensions

                                    <select class="mdb-select">
                                        <option value="" disabled selected>Units</option>
                                        <option value="1">Option 1</option>
                                        <option value="2">Option 2</option>
                                        <option value="3">Option 3</option>
                                    </select>

                                </form>
                                <form class="form-inline">

                                        <input type="text" id="form1" class="form-control">
                                        Width

                                        <input type="text" id="form1" class="form-control">
                                        Height

                                        <input type="text" id="form1" class="form-control">
                                        Depth

                                </form>
                                <form>

                                            <input type="text" id="form41" class="form-control">
                                            Weight

                                </form>
                                <form class="form-inline">

ART Specifics

                                                <select class="mdb-select">
                                                    <option value="" disabled selected>Medium</option>
                                                    <option value="1">Option 1</option>
                                                    <option value="2">Option 2</option>
                                                    <option value="3">Option 3</option>
                                                </select>

                                                <select class="mdb-select">
                                                    <option value="" disabled selected>Material</option>
                                                    <option value="1">Option 1</option>
                                                    <option value="2">Option 2</option>
                                                    <option value="3">Option 3</option>
                                                </select>

<select class="mdb-select">
                                                <option value="" disabled selected>Styles</option>
                                                <option value="1">Option 1</option>
                                                <option value="2">Option 2</option>
                                                <option value="3">Option 3</option>
                                            </select>

                                </form>
                                <form>

                                        <input type="text" id="form1" class="form-control">
                                        Keywords/Tags (Type 5 to 20 items)

                                </form>

                            <form>
                                <input type="button" class="default-next sprite" alt="Submit">

                            </form>

css(previous button and next button)

.uploadart_content .default-next{
      width: 83px;
      height: 65px;
      margin-right: 8px;
      display: inline-block;
      vertical-align: middle;
      background-position: -71px -235px;
      margin-top: 341px;
      border:none;
      outline: none;

    }
    .uploadart_content .default_previous{
      width: 83px;
      height: 65px;
      margin-right: 8px;
      display: inline-block;
      vertical-align: middle;
      background-position: -139px -235px;
      margin-top: 341px;
      border:none;
      outline: none;
    }

Body:
you can do that in css using the media property for mobile width:

@media all and (max-width:767px){
    .row{
        position: relative;
        padding-top:30px;//the height of your arrows
    }
    .row .col-md-1{
        position: absolute;
        top: 0;
    }
    .row .col-md-1:first-child{
        left:0;
    }
    .row .col-md-1:last-child{
        right:0;
    }
}

Alternatively you can stop to use bootstrap float left and start the use of display:flex. You can use order property to prepend the last child in the second place


问:
Can we delete duplicate records from a table in teradata without using intermediate table
Can we delete duplicate records from a multiset table in teradata without using intermediate table.

Suppose we have 2 rows with values
1, 2, 3
and 1, 2, 3
in my multiset table then after delete i should have
only one row i.e. 1, 2, 3.

答:
Use the same approach, but create a volatile table in the middle.

CREATE VOLATILE MULTISET TABLE TEMPDB.TEMP_DUP_ID  (

    Row_ID DECIMAL(31,0)
) PRIMARY INDEX (Row_ID)
ON COMMIT PRESERVE ROWS;

INSERT INTO TEMPDB.TEMP_DUP_ID
SELECT ROW_ID
FROM DB.TABLE T
QUALIFY ROW_NUMBER() OVER (PARTITION BY DUP ORDER BY DUP DESC) > 1

Then use the table to delete.

Ideally you will have unique key per row, otherwise, you will need to manipulate the data a bit more to generate one (with row_number() for instance... This is just a recommendation).


问:
Stop service in an activity
I'm using following code to stop my service

```<code>Intent intent = new Intent(MainActivity.this, UsageRecorderService.class);
stopService(intent);
</code>```

And this is my service that works indefinitely

```<code>public class UsageRecorderService extends IntentService {

  public UsageRecorderService() {
      super("UsageRecorder");
  }

  @Override
  protected void onHandleIntent(Intent intent) {

      while (true) {

          UsageRecorder.recordUsages(this, false);

          SystemClock.sleep(10000);
      }
   }
}
</code>```

Why does not stop my service?

答: An IntentService is designed to stop itself only when all the requests present in the work queue have been handled.Android stops the service after all start requests have been handled.</p>

Title: Stop service in an activity

Body:
I'm using following code to stop my service

Intent intent = new Intent(MainActivity.this, UsageRecorderService.class);
stopService(intent);

And this is my service that works indefinitely

public class UsageRecorderService extends IntentService {

  public UsageRecorderService() {
      super("UsageRecorder");
  }

  @Override
  protected void onHandleIntent(Intent intent) {

      while (true) {

          UsageRecorder.recordUsages(this, false);

          SystemClock.sleep(10000);
      }
   }
}

Why does not stop my service?


问:
Header location page and session destroy not working
I have a code a to do log out

The Problem is i can't header to index page after session_unset and session_destroy it stay in the page logout.php

i use ob_start();
and exit(); after the header

i also tried to use

```<code>header("Location:index.php");
</code>```

also i tried to use

```<code>header("Location: https://sitename.com/index.php");
</code>```

also i tried to use

```<code>$home_url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/index.php';
header('Location: ' . $home_url);
</code>```

also i tried to use

```<code>echo "<script type='text/javascript'>  window.location='index.php'; </script>";
</code>```

and i tried to echo the session after session_unset and session destroy nothing appear if i print the session before that i have the value of the session
if i click back on the browser button i return back without any problem
This my logout code

```<code><?php
ob_start();
session_start();
include("includes/connect.php");
include("includes/functions.php");
$userid=$_SESSION["userid"];
$date=date('Y-m-d H:i:s');
$query=mysqli_query($conn,"update tbl_user set db_isonline='0' where db_uid='$userid'")or die(mysqli_query($conn));
$sql=mysqli_query($conn,"select db_userid,db_loginid from tbl_login where db_userid='$userid' order by db_datetime desc limit 1")or die(mysqli_error($conn));
$row=mysqli_fetch_array($sql);
$id=$row['db_loginid'];
$update_query=mysqli_query($conn,"update tbl_login set db_datetimeout='$date' where db_loginid='$id'")or die(mysqli_error($conn));
    $tables = array();
$showTable = "SHOW TABLES from $DbName";
$getData = mysqli_query($conn, $showTable);
while ($row = mysqli_fetch_row($getData)) {
   $tables[] = $row;
}
Export_Database($mysqlHostName,$mysqlUserName,$mysqlPassword,$DbName,  $tables=false, $backup_name=false );
session_unset($_SESSION["userid"]);
session_destroy();
header("Location:index.php");
exit();
ob_end_flush();
?>
</code>```

Can some help to fixed this problem ??!!

答:
Used This :

```<code>header('Refresh: 1; URL=index.php');
</code>```

Body:
I have a code a to do log out

The Problem is i can't header to index page after session_unset and session_destroy it stay in the page logout.php

i use ob_start();
and exit(); after the header

i also tried to use

header("Location:index.php");

also i tried to use

header("Location: https://sitename.com/index.php");

also i tried to use

$home_url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/index.php';
header('Location: ' . $home_url);

also i tried to use

echo "";

and i tried to echo the session after session_unset and session destroy nothing appear if i print the session before that i have the value of the session
if i click back on the browser button i return back without any problem
This my logout code

<?php
ob_start();
session_start();
include("includes/connect.php");
include("includes/functions.php");
$userid=$_SESSION["userid"];
$date=date('Y-m-d H:i:s');
$query=mysqli_query($conn,"update tbl_user set db_isonline='0' where db_uid='$userid'")or die(mysqli_query($conn));
$sql=mysqli_query($conn,"select db_userid,db_loginid from tbl_login where db_userid='$userid' order by db_datetime desc limit 1")or die(mysqli_error($conn));
$row=mysqli_fetch_array($sql);
$id=$row['db_loginid'];
$update_query=mysqli_query($conn,"update tbl_login set db_datetimeout='$date' where db_loginid='$id'")or die(mysqli_error($conn));
    $tables = array();
$showTable = "SHOW TABLES from $DbName";
$getData = mysqli_query($conn, $showTable);
while ($row = mysqli_fetch_row($getData)) {
   $tables[] = $row;
}
Export_Database($mysqlHostName,$mysqlUserName,$mysqlPassword,$DbName,  $tables=false, $backup_name=false );
session_unset($_SESSION["userid"]);
session_destroy();
header("Location:index.php");
exit();
ob_end_flush();
?>

Can some help to fixed this problem ??!!

Body:
Used This :

header('Refresh: 1; URL=index.php');


问:
c++ parse int from string

Possible Duplicate:

  How to parse a string to an int in C++?

I have done some research and some people say to use atio and others say it's bad, and I can't get it to work anyways.

So I just want to ask flat out, whats the right way to convert a string to a int.

```<code>string s = "10";
int i = s....?
</code>```

Thanks!

答:
Some handy quick functions (if you're not using Boost):

```<code>template<typename T>
std::string ToString(const T& v)
{
    std::ostringstream ss;
    ss << v;
    return ss.str();
}

template<typename T>
T FromString(const std::string& str)
{
    std::istringstream ss(str);
    T ret;
    ss >> ret;
    return ret;
}
</code>```

Example:

```<code>int i = FromString<int>(s);
std::string str = ToString(i);
</code>```

Works for any streamable types (floats etc). You'll need to #include <sstream> and possibly also #include <string>.

ContentLicense: CC BY-SA 2.5

Title: c++ parse int from string

Body:
Possible Duplicate:

  How to parse a string to an int in C++?

I have done some research and some people say to use atio and others say it's bad, and I can't get it to work anyways.

So I just want to ask flat out, whats the right way to convert a string to a int.

string s = "10";
int i = s....?

Thanks!

Body:
Some handy quick functions (if you're not using Boost):

template<typename T>
std::string ToString(const T& v)
{
    std::ostringstream ss;
    ss << v;
    return ss.str();
}

template<typename T>
T FromString(const std::string& str)
{
    std::istringstream ss(str);
    T ret;
    ss >> ret;
    return ret;
}

Example:

int i = FromString<int>(s);
std::string str = ToString(i);

Works for any streamable types (floats etc). You'll need to #include <sstream> and possibly also #include <string>.


问:
How to do i create a unique page for each row in database with PHP?
Let's say, I enter a row in MySQL database with this form:

```<code><form action="add.php" method="post">
<input type="text" name="title" />
<input type="submit"/>
</form>
</code>```

Now, I want to make a page URL like this: example.com/title
And when someone open it, the database show that particular row.

答:
I am not sure what actually you want to try but it may be helpful to you

Follow Steps

Step 1:
If you are familiar with . htaccess then it's good, else create a file in your project root folder called .htaccess where htaccess is it's extension not a name:

Then put this into the .htaccess file:

```<code>RewriteEngine On    # Turn on the rewriting engine
RewriteRule    ^home/([0-9A-Za-z]+)/?$    home.php?title=$1    [NC,L]    # Handle product requests
</code>```

Step 2: Create file home.php in the root folder where .htaccess file exist. Now try using global variable $_GET to get the title from the url and then use it to fetch data from database as:

```<code>$title = $_GET['title'] // use $title to fetch data from database matching with it
</code>```

Now by going through the url as home/title you will be able to show data from database about that title:

Note: .htaccess file is an APACHE server configuration file.

Body:
Let's say, I enter a row in MySQL database with this form:

<form action="add.php" method="post">
<input type="text" name="title" />
<input type="submit"/>
</form>

Now, I want to make a page URL like this: example.com/title
And when someone open it, the database show that particular row.

Body:
I am not sure what actually you want to try but it may be helpful to you

Follow Steps

Step 1:
If you are familiar with . htaccess then it's good, else create a file in your project root folder called .htaccess where htaccess is it's extension not a name:

Then put this into the .htaccess file:

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    ^home/([0-9A-Za-z]+)/?$    home.php?title=$1    [NC,L]    # Handle product requests

Step 2: Create file home.php in the root folder where .htaccess file exist. Now try using global variable $_GET to get the title from the url and then use it to fetch data from database as:

$title = $_GET['title'] // use $title to fetch data from database matching with it

Now by going through the url as home/title you will be able to show data from database about that title:

Note: .htaccess file is an APACHE server configuration file.


问:
python for loop for multiple conditions
Below is the code(I know below code is wrong syntax just sharing for understanding requirement) I am using to test multiple for loop.

```<code>server = ['1']

start = 2
end = 4

for x in range(start,  end + 1) and for y in serverip:
    print x
    print y
</code>```

Requirement.
for loop iterations must not cross  server list  length or range .

```<code>Input 1

start = 2
end = 4
server list length = 1 that is server = ['1']

expected output 1:

print
x = 2
y = 1

Input 2

start = 2
end = 4
server list length = 2 that is server = ['1','2']

expected output 2:

print
x = 2
y = 1
x = 3
y = 2

Input 3

start = 1
end = 1
server list length = 2 that is server = ['1','2']

expected output 3:

print
x = 1
y = 1
</code>```

Please help.

答:
The easiest way is to use the built-in zip function suggested in the comments. zip creates a list, or an iterator in python 3, with the iterators “zipped” together. Until one of the iterators runs out.

```<code>server = ['1']

start = 2
end = 4

for x, y in zip(range(start,  end + 1), server):
    print x
    print y
</code>```

Output:

```<code>2
1
</code>```

https://docs.python.org/2/library/functions.html#zip :

This function returns a list of tuples, where the i-th tuple contains
  the i-th element from each of the argument sequences or iterables. The
  returned list is truncated in length to the length of the shortest
  argument sequence.

Title: python for loop for multiple conditions

Body:
Below is the code(I know below code is wrong syntax just sharing for understanding requirement) I am using to test multiple for loop.

server = ['1']

start = 2
end = 4

for x in range(start,  end + 1) and for y in serverip:
    print x
    print y

Requirement.
for loop iterations must not cross  server list  length or range .

Input 1

start = 2
end = 4
server list length = 1 that is server = ['1']

expected output 1:

print
x = 2
y = 1

Input 2

start = 2
end = 4
server list length = 2 that is server = ['1','2']

expected output 2:

print
x = 2
y = 1
x = 3
y = 2

Input 3

start = 1
end = 1
server list length = 2 that is server = ['1','2']

expected output 3:

print
x = 1
y = 1

Please help.

Body:
The easiest way is to use the built-in zip function suggested in the comments. zip creates a list, or an iterator in python 3, with the iterators “zipped” together. Until one of the iterators runs out.

server = ['1']

start = 2
end = 4

for x, y in zip(range(start,  end + 1), server):
    print x
    print y

Output:

2
1

https://docs.python.org/2/library/functions.html#zip :

This function returns a list of tuples, where the i-th tuple contains
  the i-th element from each of the argument sequences or iterables. The
  returned list is truncated in length to the length of the shortest
  argument sequence.


问:
Swift iOS- How to Add Button to the outside a CollectionView Cell

I want to get a deleteButton that is a delete image to sit on the outside of a collectionViewCell (it can be partially inside).

I looked at other SO answers and they said just play with the button's frame's Rect's x & y values which I did. When I set the x & y values to 0,0 I get:

```<code> class CustomCell: UICollectionViewCell {

 @IBOutlet weak var imageView: UIImageView!
 var deleteButton: UIButton!
 var deleteButtonImg: UIImage!

 override func awakeFromNib() {
     super.awakeFromNib()

 deleteButton = UIButton(frame: CGRect(x: 0, y: 0, width: frame.size.width/4, height: frame.size.width/4))

 deleteButtonImg = UIImage(named: "delete-icon")!.withRenderingMode(.alwaysTemplate)
 deleteButton.setImage(deleteButtonImg, for: .normal)
 deleteButton.tintColor = UIColor.red

 contentView.addSubview(deleteButton)
 }
</code>```

When I try to set the the Rect's x & y to -10,-10 the deleteButton gets clipped inside the cell's imageView. I don't have clipsToBounds set.

```<code> deleteButton = UIButton(frame: CGRect(x: -10, y: -10, width: frame.size.width/4, height: frame.size.width/4))
</code>```

I even tried setting clipToBounds to false but I get the same effect as pic # 3.

```<code>func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CustomCell", for: indexPath) as! CustomCell

        cell.imageView.image = myImageArray[indexPath.row]
        cell.imageView.clipsToBounds = false

        return cell
    }
</code>```

Where am I going wrong?

答:
okay u can do like below, first create a xib file and replace default view with collection view cell and set up like below,

in the above image set the class name to CustomCell (In my case) and place image view (green ) and button (blue).

and in View controller,

```<code>override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
     //register the nib to collectionview
    self.aColectionView.register(UINib(nibName: "CustomCell", bundle: nil), forCellWithReuseIdentifier: "CUSTOM_CELL")
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

func numberOfSections(in collectionView: UICollectionView) -> Int {
    return 1
}

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    return 40
}

//cell creation as u are doing
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    let cell:CustomCell = collectionView.dequeueReusableCell(withReuseIdentifier: "CUSTOM_CELL", for: indexPath) as! CustomCell
     //set the image for custom cell

    return cell
}

//return the required size
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
    return CGSize(width: 200, height: 150)
}
</code>```

and output like below,

and in custom cell class, u add any other features like action for a button and other views related code

```<code>class CustomCell:UICollectionViewCell {

  @IBOutlet weak var deleteButton: UIButton!
  @IBOutlet weak var imageView: UIImageView!

  //other view related code
}
</code>```

Body:
I want to get a deleteButton that is a delete image to sit on the outside of a collectionViewCell (it can be partially inside).

I looked at other SO answers and they said just play with the button's frame's Rect's x & y values which I did. When I set the x & y values to 0,0 I get:

 class CustomCell: UICollectionViewCell {

 @IBOutlet weak var imageView: UIImageView!
 var deleteButton: UIButton!
 var deleteButtonImg: UIImage!

 override func awakeFromNib() {
     super.awakeFromNib()

 deleteButton = UIButton(frame: CGRect(x: 0, y: 0, width: frame.size.width/4, height: frame.size.width/4))

 deleteButtonImg = UIImage(named: "delete-icon")!.withRenderingMode(.alwaysTemplate)
 deleteButton.setImage(deleteButtonImg, for: .normal)
 deleteButton.tintColor = UIColor.red

 contentView.addSubview(deleteButton)
 }

When I try to set the the Rect's x & y to -10,-10 the deleteButton gets clipped inside the cell's imageView. I don't have clipsToBounds set.

 deleteButton = UIButton(frame: CGRect(x: -10, y: -10, width: frame.size.width/4, height: frame.size.width/4))

I even tried setting clipToBounds to false but I get the same effect as pic # 3.

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CustomCell", for: indexPath) as! CustomCell

        cell.imageView.image = myImageArray[indexPath.row]
        cell.imageView.clipsToBounds = false

        return cell
    }

Where am I going wrong?

Body:
okay u can do like below, first create a xib file and replace default view with collection view cell and set up like below,

in the above image set the class name to CustomCell (In my case) and place image view (green ) and button (blue).

and in View controller,

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
     //register the nib to collectionview
    self.aColectionView.register(UINib(nibName: "CustomCell", bundle: nil), forCellWithReuseIdentifier: "CUSTOM_CELL")
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

func numberOfSections(in collectionView: UICollectionView) -> Int {
    return 1
}

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    return 40
}

//cell creation as u are doing
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    let cell:CustomCell = collectionView.dequeueReusableCell(withReuseIdentifier: "CUSTOM_CELL", for: indexPath) as! CustomCell
     //set the image for custom cell

    return cell
}

//return the required size
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
    return CGSize(width: 200, height: 150)
}

and output like below,

and in custom cell class, u add any other features like action for a button and other views related code

class CustomCell:UICollectionViewCell {

  @IBOutlet weak var deleteButton: UIButton!
  @IBOutlet weak var imageView: UIImageView!

  //other view related code
}


问:
Google ADB driver file doesn't contain a driver for my device
I've recently changed my PC and I'm stuck on installing ADB drivers. I've searched for tutorials and followed each step but after the selection of the win_usb.inf file, I got this error:

The specified location does not contain a compatible software driver for your device. If the location contains a driver, make sure it is designed to work with the Windows x64 Edition operating system.

So, I've decided to modify the .inf file manually, by reading other tutorials. After that, I could install the "ADB Composite Interface" driver but ADB still doesn't see my device.

What should I do?

Thank you in advance.

Edit: the device is LG Leon 3G and the PC has a 64 bit Intel processor with Windows 10 home edition

答:
Download this tool from here it helped me many times when i was stuck with drivers.

You just need to open this tool & fetch your device & install adb drivers


问:
Why does '<', '> ' work with wrapper classes while '==' doesn't ?
I know that '==' doesn't work with values outside the range of [-128,127] as there is a cache maintained of Integer objects within this range and the same reference is returned if value is within the range. But why does '>', '<', '>=', '<=' give correct answers even outside the range ?

```<code>Integer a=150;
Integer b=150;
System.out.println(a==b); //returns false

Integer a=150;
Integer b=150;
System.out.println(a>=b); // returns true
</code>```

Why is this happening ?

答:
The <, >, <= and >= operators are only defined for primitive types. Therefore using them on wrapper types causes the compiler to unbox the objects into primitives.

This means

```<code>System.out.println(a>=b);
</code>```

is equivalent to

```<code>System.out.println(a.intValue()>=b.intValue());
</code>```

However, the == and != operators exist for both primitive types and reference types, so using them to compare two objects of primitive wrapper types compares the references instead of the primitive values they wrap.

As Holger commented, comparison of object references with == and != existed in the Java language before auto-boxing and auto-unboxing were introduced, but comparison with <, >, <= and >= was not supported for any reference types before auto-unboxing was introduced.

This means that in the early days of Java, the a>=b of your code snippet would not pass compilation (since a and b are not primitive numeric types). On the other hand your a==b snippet would still pass compilation and return false.

Changing the behavior of == and != for reference types that happen to be wrappers of numeric primitives would change the behavior of existing code, thus breaking backwards compatibility, which is probably the reason it wasn't done.

Body:
I know that '==' doesn't work with values outside the range of [-128,127] as there is a cache maintained of Integer objects within this range and the same reference is returned if value is within the range. But why does '>', '<', '>=', '<=' give correct answers even outside the range ?

Integer a=150;
Integer b=150;
System.out.println(a==b); //returns false

Integer a=150;
Integer b=150;
System.out.println(a>=b); // returns true

Why is this happening ?

Body:
The <, >, <= and >= operators are only defined for primitive types. Therefore using them on wrapper types causes the compiler to unbox the objects into primitives.

This means

System.out.println(a>=b);

is equivalent to

System.out.println(a.intValue()>=b.intValue());

However, the == and != operators exist for both primitive types and reference types, so using them to compare two objects of primitive wrapper types compares the references instead of the primitive values they wrap.

As Holger commented, comparison of object references with == and != existed in the Java language before auto-boxing and auto-unboxing were introduced, but comparison with <, >, <= and >= was not supported for any reference types before auto-unboxing was introduced.

This means that in the early days of Java, the a>=b of your code snippet would not pass compilation (since a and b are not primitive numeric types). On the other hand your a==b snippet would still pass compilation and return false.

Changing the behavior of == and != for reference types that happen to be wrappers of numeric primitives would change the behavior of existing code, thus breaking backwards compatibility, which is probably the reason it wasn't done.


问:
optimize for loop in java
I am trying to print a square using for loop.
can the below code be improvised to print the square only using for loop instead of swing</p>

```<code>public class TestProgram {

    public static void main(String[] args) {

        TestProgram test = new TestProgram();
        test.draw(15, 4);
    }

    public void draw(int x, int y) {
        // System.out.println(".");
        System.out.println();
        int i = 0;
        int j = 0;
        for (i = 0; i < x; i++) {

            System.out.print(".");

            // continue;
        }
        for (j = x; j > y; j--) {

            System.out.println(".");
            System.out.print("\t\t");
            System.out.println(".");

        }

        for (int k = 0; k <= x; k++) {
            System.out.print(".");
        }

    }

}
</code>```

答:
I am not sure i understood currectly but you're trying to print squares without swing? But you're using system.out.print. Its a bit confusing but if its for learning programming homework from school here you go to make a square with for loops:

```<code> for (int i = 0; i < width; i++) {
        System.out.print("*");
    }
    System.out.println();
    for (int i = 0; i < height - 2; i++) {
        System.out.print("*");
        for (int j = 0; j < width - 2; j++) {
            System.out.print(" ");
        }
        System.out.println("*");
    }
    for (int i = 0; i < width; i++) {
        System.out.print("*");
    }
    System.out.println();
}
</code>```

But if you want to make rectangles (Because you mentioned swing) you should check java.awt.Rectangle2D and Rectangle:
https://docs.oracle.com/javase/7/docs/api/java/awt/Rectangle.html

Title: optimize for loop in java

Body:
I am trying to print a square using for loop.
can the below code be improvised to print the square only using for loop instead of swing

public class TestProgram {

    public static void main(String[] args) {

        TestProgram test = new TestProgram();
        test.draw(15, 4);
    }

    public void draw(int x, int y) {
        // System.out.println(".");
        System.out.println();
        int i = 0;
        int j = 0;
        for (i = 0; i < x; i++) {

            System.out.print(".");

            // continue;
        }
        for (j = x; j > y; j--) {

            System.out.println(".");
            System.out.print("\t\t");
            System.out.println(".");

        }

        for (int k = 0; k <= x; k++) {
            System.out.print(".");
        }

    }

}

Body:
I am not sure i understood currectly but you're trying to print squares without swing? But you're using system.out.print. Its a bit confusing but if its for learning programming homework from school here you go to make a square with for loops:

 for (int i = 0; i < width; i++) {
        System.out.print("*");
    }
    System.out.println();
    for (int i = 0; i < height - 2; i++) {
        System.out.print("*");
        for (int j = 0; j < width - 2; j++) {
            System.out.print(" ");
        }
        System.out.println("*");
    }
    for (int i = 0; i < width; i++) {
        System.out.print("*");
    }
    System.out.println();
}

But if you want to make rectangles (Because you mentioned swing) you should check java.awt.Rectangle2D and Rectangle:
https://docs.oracle.com/javase/7/docs/api/java/awt/Rectangle.html


问:
distinctUnionOfObjects changes the order of an array
Below is my original array :

```<code>{
    FilePath = "Selfcare.jpg";
    ModuleId = 18;
    ModuleName = "Infant N Toddler";
    SkillLevelID = 59;
    SkillLevelName = "Self Care";
},
{
    FilePath = "Preschool.jpg";
    ModuleId = 18;
    ModuleName = "Infant N Toddler";
    SkillLevelID = 60;
    SkillLevelName = "Preschool Readiness";
},
{
    FilePath = "Learning_Primary.jpg";
    ModuleId = 22;
    ModuleName = Cognitive;
    SkillLevelID = 71;
    SkillLevelName = "Learning Readiness - Primary Skills";
},
{
    FilePath = "PreAcad_Primary.jpg";
    ModuleId = 22;
    ModuleName = Cognitive;
    SkillLevelID = 72;
    SkillLevelName = "Pre-Academics: Primary Skills";
}
</code>```

when I apply distinctUnionOfObjects

```<code>NSArray *curriculums = [array valueForKeyPath:@"@distinctUnionOfObjects.ModuleName"];
</code>```

this changes the order giving me resulting array

```<code><__NSArrayI>(
Cognitive,
Infant N Toddler
)
</code>```

It should give

```<code><__NSArrayI>(
    Infant N Toddler,
    Cognitive
    )
</code>```

as per original array order.

How do I restrict this order change?

答:
please try this one </p>

```<code>NSArray *orderedSet = [[NSOrderedSet orderedSetWithArray:[people valueForKey:@"ModuleName"]] array];
</code>```

Body:
Below is my original array :

{
    FilePath = "Selfcare.jpg";
    ModuleId = 18;
    ModuleName = "Infant N Toddler";
    SkillLevelID = 59;
    SkillLevelName = "Self Care";
},
{
    FilePath = "Preschool.jpg";
    ModuleId = 18;
    ModuleName = "Infant N Toddler";
    SkillLevelID = 60;
    SkillLevelName = "Preschool Readiness";
},
{
    FilePath = "Learning_Primary.jpg";
    ModuleId = 22;
    ModuleName = Cognitive;
    SkillLevelID = 71;
    SkillLevelName = "Learning Readiness - Primary Skills";
},
{
    FilePath = "PreAcad_Primary.jpg";
    ModuleId = 22;
    ModuleName = Cognitive;
    SkillLevelID = 72;
    SkillLevelName = "Pre-Academics: Primary Skills";
}

when I apply distinctUnionOfObjects

NSArray *curriculums = [array valueForKeyPath:@"@distinctUnionOfObjects.ModuleName"];

this changes the order giving me resulting array

<__NSArrayI>(
Cognitive,
Infant N Toddler
)

It should give

<__NSArrayI>(
    Infant N Toddler,
    Cognitive
    )

as per original array order.

How do I restrict this order change?

Body:
please try this one

NSArray *orderedSet = [[NSOrderedSet orderedSetWithArray:[people valueForKey:@"ModuleName"]] array];


问:
How do I add a column to an rdlc's dataset and have it appear for use in the report?
I have an rdlc that has a separately-defined dataset. The time has come that I have the need to add a column to one of the tables, which I can do without issue. However, when I open the rdlc to use the new column, it does not appear in the Report Data pane.

This issue was reported to Microsoft here, but it was closed as by design. The workaround offered with the issue does not seem to work for VS2010 (refresh the dataset or the table; neither does anything).

Has anyone seen this problem, and if so, how did you get around it?

答:
I'm using VS 2010.

On Solution Explorer

Double click the .xsd file where your rdlc report is connected.

Right Click > Configure

Click Query Builder > Check/Select the fields you needed.

Next > Next > Finish then Save.

On RDLC Report

Press CTRL + ALT + D.

On Report Data, right click DataSet then Refresh.


问:
Download 3000+ Images Using C#?
I have a list of around 3000 image URLs, where I need to download them to my desktop.

I'm a web dev, so naturally wrote a little asp.net c# download method to do this but the obvious problem happened and the page timed out before I got hardly any of them.

Was wondering if anyone else knew of a good, quick and robust way of me looping through all the image URL's and downloading them to a folder?  Open to any suggestions, WinForms, batch file although I'm a novice at both.

Any help greatly appreciated

答: I've written a similar app in WinForms that loops through URLs in an Excel spreadsheet and downloads the image files.  I think they problem you're having with implementing this as a web application is that server will only allow the process to run for a short amount of time before the request from your browser times out.  You could either increase this time in the web.config file (change the executionTimeout attribute of the httpRuntime element), or implement this functionality as a WinForms application where the long execution time won't be a problem.  If this is more than a throw-away application and you decide to go the WinForms route, you may want to add a progress bar to ind</p>

Title: Download 3000+ Images Using C#?


问:
How to convert "jar" to Linux executable file?
I know how to convert "jar" to windows executable file(.exe). But I want to know how to convert "jar" to Linux executable file(.?). I have searched google but didn't get exact answer what i want, help to do this.</p>

答:
Create a sh wrapper file with following content and make it executable:

```<code>#!/bin/bash

java -jar <your-jar>
</code>```

Optionally add some vm arguments.

Perhaps there are some tools that could generate such a file, but is is little effort to do it manually I reckon.

Body:
Create a sh wrapper file with following content and make it executable:

#!/bin/bash

java -jar <your-jar>

Optionally add some vm arguments.

Perhaps there are some tools that could generate such a file, but is is little effort to do it manually I reckon.


问:
performSegue error when come from appDelegate
My case is something special, since this works me correctly if the application is opened in normal mode.

This is when I try to do so after receiving a push notification.

inside didReceive notification:

```<code>func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
</code>```

i'm calling a function from my initial view controller(HOME)

That is just the view that is displayed when the application opens when you click on the notification

```<code>let homeVC : HomeViewController! = HomeViewController()
homeVC.goAdvertisement(id, data: dataInfo)
</code>```

Within goAdvertisement you can find:

```<code>self.performSegue(withIdentifier: "mySegue", sender: itemData)
</code>```

And that is where the error occurs.

libc++abi.dylib: terminating with uncaught exception of type NSException

At first I thought that it could be that it was giving time to load the view so that I could execute the performSegue, and try to give it a delay using:

```<code>func delay(delay:Double, closure:@escaping ()->()) {
        DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
            closure()
        }
    }

self.delay(delay: 4, closure: {
    let homeVC : HomeViewController! = HomeViewController()
    homeVC.goAdvertisement(id, hardwareAd: dataInfo)
}
</code>```

But it does not work

Another idea that I had, was to leave aside the performSegue and try to use the present.

```<code>let vc = self.storyboard?.instantiateViewController(withIdentifier: "myVcId") as! MyController
vc.data = itemData
self.present(vc, animated: true, completion: nil)
</code>```

But this did not work either (The crash points to instantiateViewController line)

Any help will be greatly appreciated, thanks.

UPDATE

Following APK APPS answer. Finally found a way.

```<code>let storyboard = UIStoryboard(name: "Main", bundle: nil)
let homeVC: HomeViewController = storyboard.instantiateViewController(withIdentifier: "homeView") as! HomeViewController

let rootViewController = self.window!.rootViewController as! UINavigationController;
rootViewController.pushViewController(homeVC, animated: false);
</code>```

答:
From the AppDelegate class you can not perform segue. So this line will never work from your AppDelegate class.

```<code>self.performSegue(withIdentifier: "mySegue", sender: itemData)
</code>```

You Need to simple

```<code>let storyboard = UIStoryboard(name: "Main", bundle: nil)
let scheduleController = storyboard.instantiateViewController(withIdentifier: "yourIdentiFier")
self.window!.rootViewController = scheduleController
self.window!.makeKeyAndVisible()
</code>```

You can provide Identifier to you controller from your Main.storyboard Follow these steps.

Open Main StoryBoard

Click Your View Which you want to open

Select Yellow/ Left button from top of that controller

Now Open your Utility box which would be in the Right side

Now Click on the Show the Identical Inspector

Now here you can give your Identity as StoryBoard Id

Body:
My case is something special, since this works me correctly if the application is opened in normal mode.

This is when I try to do so after receiving a push notification.

inside didReceive notification:

func application(_ application: UIApplication, didReceive notification: UILocalNotification) {

i'm calling a function from my initial view controller(HOME)

That is just the view that is displayed when the application opens when you click on the notification

let homeVC : HomeViewController! = HomeViewController()
homeVC.goAdvertisement(id, data: dataInfo)

Within goAdvertisement you can find:

self.performSegue(withIdentifier: "mySegue", sender: itemData)

And that is where the error occurs.

libc++abi.dylib: terminating with uncaught exception of type NSException

At first I thought that it could be that it was giving time to load the view so that I could execute the performSegue, and try to give it a delay using:

func delay(delay:Double, closure:@escaping ()->()) {
        DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
            closure()
        }
    }

self.delay(delay: 4, closure: {
    let homeVC : HomeViewController! = HomeViewController()
    homeVC.goAdvertisement(id, hardwareAd: dataInfo)
}

But it does not work

Another idea that I had, was to leave aside the performSegue and try to use the present.

let vc = self.storyboard?.instantiateViewController(withIdentifier: "myVcId") as! MyController
vc.data = itemData
self.present(vc, animated: true, completion: nil)

But this did not work either (The crash points to instantiateViewController line)

Any help will be greatly appreciated, thanks.

UPDATE

Following APK APPS answer. Finally found a way.

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let homeVC: HomeViewController = storyboard.instantiateViewController(withIdentifier: "homeView") as! HomeViewController

let rootViewController = self.window!.rootViewController as! UINavigationController;
rootViewController.pushViewController(homeVC, animated: false);

Body:
From the AppDelegate class you can not perform segue. So this line will never work from your AppDelegate class.

self.performSegue(withIdentifier: "mySegue", sender: itemData)

You Need to simple

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let scheduleController = storyboard.instantiateViewController(withIdentifier: "yourIdentiFier")
self.window!.rootViewController = scheduleController
self.window!.makeKeyAndVisible()

You can provide Identifier to you controller from your Main.storyboard Follow these steps.

Open Main StoryBoard

Click Your View Which you want to open

Select Yellow/ Left button from top of that controller

Now Open your Utility box which would be in the Right side

Now Click on the Show the Identical Inspector

Now here you can give your Identity as StoryBoard Id

ContentLicense: CC BY-SA 4.0


问:
Kurento Android onLocalSdpOfferGenerated is not triggered
The callback onLocalSdpOfferGenerated is not get triggered after when offer generated nbmWebRTCPeer.generateOffer("local", true);.

Why this call back is not get triggered ?

I have already asked question with complete code in this link but i didn't get any answer for that.

答:
It was solved by commenting log in the callback function

```<code>//Log.d("onLclSdpOfrGen","******** localSdpOffer : "+localSdpOffer.description+" connection : "+connection.getConnectionId());
</code>```

but still i cant establish peer connection. here i am following tutorial http://doc-webrtcpeer-android.readthedocs.io/en/latest/DevelopersGuide.html

```<code>@Override
public void onLocalSdpOfferGenerated(SessionDescription localSdpOffer, NBMPeerConnection connection) {

//Log.d("onLclSdpOfrGen","******** localSdpOffer : "+localSdpOffer.description+" connection : "+connection.getConnectionId());

if (!isMyVideoPublished) {

    kurentoRoomAPI.sendPublishVideo(localSdpOffer.description,false,129);

    //String username = "qwerty";
    //kurentoRoomAPI.sendReceiveVideoFrom(username, "webcam", localSdpOffer.description, 129);

    isMyVideoPublished = true;
}else {

    String username = "qwerty";
    kurentoRoomAPI.sendReceiveVideoFrom(username, "webcam", localSdpOffer.description, 129);

}
}
</code>```

Body:
It was solved by commenting log in the callback function

//Log.d("onLclSdpOfrGen","******** localSdpOffer : "+localSdpOffer.description+" connection : "+connection.getConnectionId());

but still i cant establish peer connection. here i am following tutorial http://doc-webrtcpeer-android.readthedocs.io/en/latest/DevelopersGuide.html

@Override
public void onLocalSdpOfferGenerated(SessionDescription localSdpOffer, NBMPeerConnection connection) {

//Log.d("onLclSdpOfrGen","******** localSdpOffer : "+localSdpOffer.description+" connection : "+connection.getConnectionId());

if (!isMyVideoPublished) {

    kurentoRoomAPI.sendPublishVideo(localSdpOffer.description,false,129);

    //String username = "qwerty";
    //kurentoRoomAPI.sendReceiveVideoFrom(username, "webcam", localSdpOffer.description, 129);

    isMyVideoPublished = true;
}else {

    String username = "qwerty";
    kurentoRoomAPI.sendReceiveVideoFrom(username, "webcam", localSdpOffer.description, 129);

}
}


问:
git push with backdate
I had to backdate my computer and without realizing pushed some changes to the remote git repository.
Now when I see the commits in the git web view, my commit is shown as backdated.
However, all the code has merged just fine it includes the changes from previous commits by other developers.

Will the backdate cause any problem ?
Please let me know.

答:
The merge is done according to the commit history, a 3-way merge  based on a common ancestor.

It does not depend on the commit or author dates.

The commits are linked together through a parent relationship in a DAG, no matter what their date is.

Source: "Branching and Merging" from Eric C. Anderson

Title: git push with backdate


问:
Change column name in edmx
How can I change the column name in the class generated by .edmx? Not for the view purpose, instead changed column names should be available in the controller, so that meaningful column names are available for developers

答: I know your asking about edmx , but if you use the editor I know you can setup mapping to change column names to more readable names.  You click on the column then go to properties , or open the mapping window.  I would not recommend changing the edmx as it gets over written and you would just have to do it all over again.</p>

Title: Change column name in edmx


问:
What exactly is the zookeeper quorum setting in hbase-site.xml?
What exactly is the zookeeper quorum setting in hbase-site.xml?</p>

答:
From the hbase-default.xml file:

Comma separated list of servers in the ZooKeeper Quorum.
      For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
      By default this is set to localhost for local and pseudo-distributed modes
      of operation. For a fully-distributed setup, this should be set to a full
      list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh
      this is the list of servers which we will start/stop ZooKeeper on.

And from the Getting Started's Requirements section:

HBase depends on ZooKeeper as of release 0.20.0. HBase keeps the location of its root table, who the current master is, and what regions are currently participating in the cluster in ZooKeeper. Clients and Servers now must know their ZooKeeper Quorum locations before they can do anything else (Usually they pick up this information from configuration supplied on their CLASSPATH). By default, HBase will manage a single ZooKeeper instance for you. In standalone and pseudo-distributed modes this is usually enough, but for fully-distributed mode you should configure a ZooKeeper quorum (more info below).

Hope that helps.


问:
Javascript Character Replacement
I'm trying to create a translation tool where somebody can enter text into a form and the translation automatically processes with each keystroke into a corresponding form.

The translation is per character in an array. Each Key will be replaced with its corresponding Value pair.

I don't know why the text won't output.

Here is the Code:

var array = {
  'a': 'z',
  'b': 'y',
  'c': 'x',
  'd': 'w',
  'e': 'v',
  'f': 'u',
  'g': 't',
  'h': 's',
  'i': 'r',
  'j': 'q',
  'k': 'p',
  'l': 'o',
  'm': 'n',
  'n': 'm',
  'o': 'l',
  'p': 'k',
  'q': 'j',
  'r': 'i',
  's': 'h',
  't': 'g',
  'u': 'f',
  'v': 'e',
  'w': 'd',
  'x': 'c',
  'y': 'b',
  'z': 'a'
};

var english = document.getElementById('englishform');
var backwards = document.getElementById('backwardsform');

var new_str = english;

for (var key in array) {
  if (!array.hasOwnProperty(key)) {
    continue;
  }

  new_str = new_str.replace(new RegExp(key, "g"), array[key]);
}

english.value = new_str;

english.onkeyup = function() {
  backwards.value = english.value;
};```
<pre class="snippet-code-html lang-html prettyprint-override"><code><form action="home.html" method="post">
  <textarea class="form-control" id="englishform" placeholder="Enter English" rows="15">
    </textarea>
</form>
<form>
  <textarea class="form-control" id="backwardsform" placeholder="Enter Backwards English" rows="15">
    </textarea>
</form></code>```

答:
Your error is here:

```<code>var new_str = english;
</code>```

Change this to:

```<code>var new_str = english.value;
</code>```

Title: Javascript Character Replacement

Body:
I'm trying to create a translation tool where somebody can enter text into a form and the translation automatically processes with each keystroke into a corresponding form.

The translation is per character in an array. Each Key will be replaced with its corresponding Value pair.

I don't know why the text won't output.

Here is the Code:

var array = {
  'a': 'z',
  'b': 'y',
  'c': 'x',
  'd': 'w',
  'e': 'v',
  'f': 'u',
  'g': 't',
  'h': 's',
  'i': 'r',
  'j': 'q',
  'k': 'p',
  'l': 'o',
  'm': 'n',
  'n': 'm',
  'o': 'l',
  'p': 'k',
  'q': 'j',
  'r': 'i',
  's': 'h',
  't': 'g',
  'u': 'f',
  'v': 'e',
  'w': 'd',
  'x': 'c',
  'y': 'b',
  'z': 'a'
};

var english = document.getElementById('englishform');
var backwards = document.getElementById('backwardsform');

var new_str = english;

for (var key in array) {
  if (!array.hasOwnProperty(key)) {
    continue;
  }

  new_str = new_str.replace(new RegExp(key, "g"), array[key]);
}

english.value = new_str;

english.onkeyup = function() {
  backwards.value = english.value;
};

<form action="home.html" method="post">
  <textarea class="form-control" id="englishform" placeholder="Enter English" rows="15">
    </textarea>
</form>
<form>
  <textarea class="form-control" id="backwardsform" placeholder="Enter Backwards English" rows="15">
    </textarea>
</form>

Body:
Your error is here:

var new_str = english;

Change this to:

var new_str = english.value;


问:
How to pass arguments to initialize method from a class?
I am using Push8 gem for Apple push notification which accepts .P8 certificates.The problem is that I have two bundle_id for two separate apps and need to send Push Notifications to both of them. The Push8 gem accepts bundle_id ENV['APN_BUNDLE_ID'] params automatically from the application.yml file. However, I want it to use ENV['APN_VENDOR_BUNDLE_ID'] as well for a different APP to send Push Notification.

my code to send Push notification is here

```<code>  def self.send_notification_ios(device_id, notification_id)
    send = Notification.where(id: notification_id).first
     if Rails.env == 'development'
        apn = P8push::Client.development
     else
        apn = P8push::Client.production
     end

    token = device_id
    notification = P8push::Notification.new(device: token)
    notification.alert = send.template.message % { txnid: send.order.txnid }
    notification.sound = 'sosumi.aiff'
    apn.push(notification)
    end
</code>```

Here If the send.end_user_type is "User" I want to use the Bundle id APN_BUNDLE_ID as the topic, for rest as want to use APN_VENDOR_BUNDLE_ID. But I dont know how to pass APN_VENDOR_BUNDLE_ID as a param to initialize method in the client.rb file of the gem. Hence it always accepts APN_BUNDLE_ID as the topic and hence throws the error topic disallowed.

Here is the client.rb file for the gem:
https://github.com/andrewarrow/p8push/blob/master/lib/p8push/client.rb

The link for the gem is https://github.com/andrewarrow/p8push

答:
If the initialize method makes no accommodations for customizing that attribute you've got two choices: Monkey-patch it to make it do what you want, which is messy, or subclass it and use that instead.

The sub-class solution looks like this:

```<code>class UserAwareClient < P8Push::Client
  def self.development(user_type)
    client = self.new(user_type)
    client.jwt_uri = APPLE_DEVELOPMENT_JWT_URI
    client
  end

  def self.production(user_type)
    client = self.new(user_type)
    client.jwt_uri = APPLE_PRODUCTION_JWT_URI
    client
  end

  def initialize(user_type)
    # Initialize as the parent class would
    super

    # Then detect the user_type argument and decide how to configure it
    @private_key =
      case (user_type)
      when 'User'
        File.read(ENV['APN_PRIVATE_KEY'])
      else
        File.read(ENV['APN_VENDOR_BUNDLE_ID'])
      end
    end
  end
end
</code>```

Then you create that:

```<code>apn = UserAwareClient.development(user_type)
</code>```

This gem could be made a lot more flexible with a few pull-requests to make your life easier, so consider that, too.

Body:
I am using Push8 gem for Apple push notification which accepts .P8 certificates.The problem is that I have two bundle_id for two separate apps and need to send Push Notifications to both of them. The Push8 gem accepts bundle_id ENV['APN_BUNDLE_ID'] params automatically from the application.yml file. However, I want it to use ENV['APN_VENDOR_BUNDLE_ID'] as well for a different APP to send Push Notification.

my code to send Push notification is here

  def self.send_notification_ios(device_id, notification_id)
    send = Notification.where(id: notification_id).first
     if Rails.env == 'development'
        apn = P8push::Client.development
     else
        apn = P8push::Client.production
     end

    token = device_id
    notification = P8push::Notification.new(device: token)
    notification.alert = send.template.message % { txnid: send.order.txnid }
    notification.sound = 'sosumi.aiff'
    apn.push(notification)
    end

Here If the send.end_user_type is "User" I want to use the Bundle id APN_BUNDLE_ID as the topic, for rest as want to use APN_VENDOR_BUNDLE_ID. But I dont know how to pass APN_VENDOR_BUNDLE_ID as a param to initialize method in the client.rb file of the gem. Hence it always accepts APN_BUNDLE_ID as the topic and hence throws the error topic disallowed.

Here is the client.rb file for the gem:
https://github.com/andrewarrow/p8push/blob/master/lib/p8push/client.rb

The link for the gem is https://github.com/andrewarrow/p8push

Body:
If the initialize method makes no accommodations for customizing that attribute you've got two choices: Monkey-patch it to make it do what you want, which is messy, or subclass it and use that instead.

The sub-class solution looks like this:

class UserAwareClient < P8Push::Client
  def self.development(user_type)
    client = self.new(user_type)
    client.jwt_uri = APPLE_DEVELOPMENT_JWT_URI
    client
  end

  def self.production(user_type)
    client = self.new(user_type)
    client.jwt_uri = APPLE_PRODUCTION_JWT_URI
    client
  end

  def initialize(user_type)
    # Initialize as the parent class would
    super

    # Then detect the user_type argument and decide how to configure it
    @private_key =
      case (user_type)
      when 'User'
        File.read(ENV['APN_PRIVATE_KEY'])
      else
        File.read(ENV['APN_VENDOR_BUNDLE_ID'])
      end
    end
  end
end

Then you create that:

apn = UserAwareClient.development(user_type)

This gem could be made a lot more flexible with a few pull-requests to make your life easier, so consider that, too.


问:
How to start HSQLDB in server mode from Spring boot application
I have a Spring boot application, running with jpa data and hsqldb 2.3.3 (in Centos 7), the application runs fine but I would like to use HSQLDB database manager to check the data status, however it failed:

application.properties:

```<code>spring.datasource.url=jdbc:hsqldb:mem:testdb
spring.datasource.username=sa
spring.datasource.password=

spring.jpa.database-platform=org.hibernate.dialect.HSQLDialect
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
</code>```

Command to start HSQLDB:

```<code>java -cp /home/mycentos/.m2/repository/org/hsqldb/hsqldb/2.3.3/hsqldb-2.3.3.jar org.hsqldb.util.DatabaseManagerSwing
</code>```

If I tried to log in with HSQLDB server mode, it pops Connection refused error

```<code>jdbc:hsqldb:hsql://localhost/testdb
</code>```

If I tried to log in in-memory db, I can log in but no table and data showing up

```<code>jdbc:hsqldb:hsql:testdb
</code>```

Question:

How to make it works?

Do I have to refer to the hsqldb.jar from tomcat deployment folder because that is the one using by the application?

Any configuration difference to configure hsqldb in server mode or in-memory mode from Spring application?

Can any method make in-memory mode working in such situation (to check data by db created Spring boot)?

答:
Just to add to beckyang's answer, here is my approach.

Includes a hack to redirect logs to slf4j.

Includes specifying a corresponding datasource.

```

    import org.hsqldb.jdbc.JDBCDataSource;
    import org.hsqldb.server.Server;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import org.springframework.beans.factory.annotation.Value;
    import org.springframework.boot.context.properties.ConfigurationProperties;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.context.annotation.Primary;

    import javax.sql.DataSource;
    import java.io.ByteArrayOutputStream;
    import java.io.PrintWriter;

    @Configuration
    public class DataSourceConfiguration {

        private final Logger log = LoggerFactory.getLogger(getClass());

        @Bean(initMethod = "start", destroyMethod = "stop")
        @ConfigurationProperties//(prefix = "alarms.idempotent.server")
        public Server idempotentServer(@Value("${alarms.idempotent.server.path}") String path, @Value("${alarms.idempotent.port}") int port, @Value("${alarms.idempotent.name}") String name) {

            Server server = new Server();
            server.setDatabaseName(0, name);
            server.setDatabasePath(0, path);
            server.setPort(port);
            server.setLogWriter(slf4jPrintWriter());
            server.setErrWriter(slf4jPrintWriter());

            return server;

        }

        @Bean("idempotentDataSource")
        @Primary
        @ConfigurationProperties
        public DataSource idempotentDataSource(@Value("${alarms.idempotent.datasource.url}") String urlNoPath, @Value("${alarms.idempotent.name}") String name) {
            JDBCDataSource jdbcDataSource = new JDBCDataSource();
            String url = urlNoPath;
            if (!url.endsWith("/")) {
                url += "/";
            }
            url += name;
            jdbcDataSource.setUrl(url);
            jdbcDataSource.setUser("sa");
            return jdbcDataSource;
        }

        private PrintWriter slf4jPrintWriter() {
            PrintWriter printWriter = new PrintWriter(new ByteArrayOutputStream()) {
                @Override
                public void println(final String x) {
                    log.debug(x);
                }
            };
            return printWriter;
        }

    }

```

Body:
I have a Spring boot application, running with jpa data and hsqldb 2.3.3 (in Centos 7), the application runs fine but I would like to use HSQLDB database manager to check the data status, however it failed:

application.properties:

spring.datasource.url=jdbc:hsqldb:mem:testdb
spring.datasource.username=sa
spring.datasource.password=

spring.jpa.database-platform=org.hibernate.dialect.HSQLDialect
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create

Command to start HSQLDB:

java -cp /home/mycentos/.m2/repository/org/hsqldb/hsqldb/2.3.3/hsqldb-2.3.3.jar org.hsqldb.util.DatabaseManagerSwing

If I tried to log in with HSQLDB server mode, it pops Connection refused error

jdbc:hsqldb:hsql://localhost/testdb

If I tried to log in in-memory db, I can log in but no table and data showing up

jdbc:hsqldb:hsql:testdb

Question:

How to make it works?

Do I have to refer to the hsqldb.jar from tomcat deployment folder because that is the one using by the application?

Any configuration difference to configure hsqldb in server mode or in-memory mode from Spring application?

Can any method make in-memory mode working in such situation (to check data by db created Spring boot)?

Body:
Just to add to beckyang's answer, here is my approach.

Includes a hack to redirect logs to slf4j.

Includes specifying a corresponding datasource.

    import org.hsqldb.jdbc.JDBCDataSource;
    import org.hsqldb.server.Server;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import org.springframework.beans.factory.annotation.Value;
    import org.springframework.boot.context.properties.ConfigurationProperties;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.context.annotation.Primary;

    import javax.sql.DataSource;
    import java.io.ByteArrayOutputStream;
    import java.io.PrintWriter;

    @Configuration
    public class DataSourceConfiguration {

        private final Logger log = LoggerFactory.getLogger(getClass());

        @Bean(initMethod = "start", destroyMethod = "stop")
        @ConfigurationProperties//(prefix = "alarms.idempotent.server")
        public Server idempotentServer(@Value("${alarms.idempotent.server.path}") String path, @Value("${alarms.idempotent.port}") int port, @Value("${alarms.idempotent.name}") String name) {

            Server server = new Server();
            server.setDatabaseName(0, name);
            server.setDatabasePath(0, path);
            server.setPort(port);
            server.setLogWriter(slf4jPrintWriter());
            server.setErrWriter(slf4jPrintWriter());

            return server;

        }

        @Bean("idempotentDataSource")
        @Primary
        @ConfigurationProperties
        public DataSource idempotentDataSource(@Value("${alarms.idempotent.datasource.url}") String urlNoPath, @Value("${alarms.idempotent.name}") String name) {
            JDBCDataSource jdbcDataSource = new JDBCDataSource();
            String url = urlNoPath;
            if (!url.endsWith("/")) {
                url += "/";
            }
            url += name;
            jdbcDataSource.setUrl(url);
            jdbcDataSource.setUser("sa");
            return jdbcDataSource;
        }

        private PrintWriter slf4jPrintWriter() {
            PrintWriter printWriter = new PrintWriter(new ByteArrayOutputStream()) {
                @Override
                public void println(final String x) {
                    log.debug(x);
                }
            };
            return printWriter;
        }

    }


问:
Simple jQuery problem
This one should be easy

I've got this HTML

```<code><table class="PageNumbers">
<tr>
    <td colspan="3">text3
    </td>
</tr>
<tr>
    <td colspan="2">text
    </td>
    <td>text2
    </td>
</tr>
<tr>
    <td>moretext
    </td>
    <td>moretext2
    </td>
<td>moretext3
    </td>
</tr>
</table>
</code>```

I need to change the colspan of the first rows first column to one

This is what i've got

```<code>$('.PageNumbers tr:first td:first').attr('colspan') = '1'
</code>```

Doesn't seem to work though

Any ideas?

Thanks

答:
This should be the fastest.</p>

```<code>$('.PageNumbers tr td').eq(0).attr('colspan',1);
</code>```

Title: Simple jQuery problem

Body:
This one should be easy

I've got this HTML

    text3

    text

    text2

    moretext

    moretext2

moretext3

I need to change the colspan of the first rows first column to one

This is what i've got

$('.PageNumbers tr:first td:first').attr('colspan') = '1'

Doesn't seem to work though

Any ideas?

Thanks

Body:
This should be the fastest.

$('.PageNumbers tr td').eq(0).attr('colspan',1);


问:
Can't figure out how to get basic ruby 'encryptor' to work
Basically want to make 'abc' into 'bcd'. I was thinking if I add the letter the follows the first to the end of the phrase and dropped the original first letter, eventually I'd get the final solution. Got kinda stuck and was hoping someone could shed some light on it for me. Thanks</p>

```<code>def encrypt(str)
  index = 0
  encrypted_str = ""
  duration = str.length
  until index == str.length
    encrypted_str = str + str[0].next
    encrypted_str = encrypted_str + encrypted_str.delete(str[index])
    index += 1
  end
  puts encrypted_str
end

#puts "What would you like to encrypt?"
message = "abc"
puts encrypt(message)
</code>```

答:
```<code>ENCRYPT = [*'a'..'z'].zip([*'b'..'z', 'a']).to_h
  #=> {"a"=>"b", "b"=>"c",..., "y"=>"z", "z"=>"a"}
DECRYPT = ENCRYPT.invert
  #=> {"b"=>"a", "c"=>"b",..., "z"=>"y", "a"=>"z"}

def encrypt(str)
  crypt(str, ENCRYPT)
end

def decrypt(str)
  crypt(str, DECRYPT)
end

def crypt(str, mapping)
  str.gsub(/./, mapping)
end

encrypt('abc')   #=> "bcd"
decrypt('bcd')   #=> "abc"

encrypt('amnrz') #=> "bnosa"
decrypt('bnosa') #=> "amnrz"
</code>```

This uses the form of String#gsub that takes a hash as an argument. See also Hash#invert.

Body:
Basically want to make 'abc' into 'bcd'. I was thinking if I add the letter the follows the first to the end of the phrase and dropped the original first letter, eventually I'd get the final solution. Got kinda stuck and was hoping someone could shed some light on it for me. Thanks

def encrypt(str)
  index = 0
  encrypted_str = ""
  duration = str.length
  until index == str.length
    encrypted_str = str + str[0].next
    encrypted_str = encrypted_str + encrypted_str.delete(str[index])
    index += 1
  end
  puts encrypted_str
end

#puts "What would you like to encrypt?"
message = "abc"
puts encrypt(message)

Body:
ENCRYPT = [*'a'..'z'].zip([*'b'..'z', 'a']).to_h
  #=> {"a"=>"b", "b"=>"c",..., "y"=>"z", "z"=>"a"}
DECRYPT = ENCRYPT.invert
  #=> {"b"=>"a", "c"=>"b",..., "z"=>"y", "a"=>"z"}

def encrypt(str)
  crypt(str, ENCRYPT)
end

def decrypt(str)
  crypt(str, DECRYPT)
end

def crypt(str, mapping)
  str.gsub(/./, mapping)
end

encrypt('abc')   #=> "bcd"
decrypt('bcd')   #=> "abc"

encrypt('amnrz') #=> "bnosa"
decrypt('bnosa') #=> "amnrz"

This uses the form of String#gsub that takes a hash as an argument. See also Hash#invert.


问:
Where can be Ejabberd.yml?
I want to configure Ejabbered.yml I've checked different paths.

1> C:\Users\Abhishek\AppData\Roaming

2> C:\Program Files\ejabberd-17.04\bin\

I am not able to find anywhere.

Please help

答:
Not available on the ejabberd website

I found mine in: C:\ProgramData\ejabberd\conf

Title: Where can be Ejabberd.yml?